a0984961b3f0c7fbe38fb189232404d71ad5b908
[debian/openrocket] / core / src / net / sf / openrocket / unit / FixedUnitGroup.java
1 package net.sf.openrocket.unit;
2
3 /*
4  * This class provides a 'dumb' version of UnitGroup
5  * It allows any arbitrary unit to be created. It doesn't store any value and can't be converted into anything else.
6  * This is useful for custom expression units.
7  * 
8  * @author Richard Graham
9  */
10
11 public class FixedUnitGroup extends UnitGroup {
12         
13         String unitString;
14         
15         public FixedUnitGroup( String unitString ){
16                 this.unitString = unitString; 
17         }
18         
19         public int getUnitCount(){
20                 return 1;
21         }
22         
23         public Unit getDefaultUnit(){
24                 return new GeneralUnit(1, unitString);
25         }
26         
27         public boolean contains(Unit u){
28                 return true;
29         }
30         
31 }