@@ -46,6 +46,18 @@ public enum Unit implements SimpleConvert
4646 bottles (KindOfQuantity .Count , unit , 1.0 , 2 , "bottles" ,
4747 Quantity .class ,
4848 "bottle" , "bottles" ),
49+ organisms (KindOfQuantity .Count , unit , 1.0 , 2 , "organisms" ,
50+ Quantity .class ,
51+ "organism" , "organisms" ),
52+ vials (KindOfQuantity .Count , unit , 1.0 , 2 , "vials" ,
53+ Quantity .class ,
54+ "vial" , "vials" ),
55+ tubes (KindOfQuantity .Count , unit , 1.0 , 2 , "tubes" ,
56+ Quantity .class ,
57+ "tube" , "tubes" ),
58+ syringes (KindOfQuantity .Count , unit , 1.0 , 2 , "syringes" ,
59+ Quantity .class ,
60+ "syringe" , "syringes" ),
4961
5062 mL (KindOfQuantity .Volume , null , 1e0 , 6 , "mL" ,
5163 Quantity .Volume_ml .class ,
@@ -130,7 +142,7 @@ public enum Unit implements SimpleConvert
130142 this .quantityClass = quantityClass ;
131143 this .singular = singular ;
132144 this .plural = plural ;
133- this .otherNames = null == otherNames || otherNames .length == 0 ? null : otherNames ;
145+ this .otherNames = null == otherNames || otherNames .length == 0 ? null : otherNames ;
134146 }
135147
136148 public boolean isBase ()
@@ -173,7 +185,8 @@ public String toString()
173185 return print ;
174186 }
175187
176- static final HashMap <String ,Unit > unitMap = new HashMap <>(Unit .values ().length *10 );
188+ static final HashMap <String , Unit > unitMap = new HashMap <>(Unit .values ().length * 10 );
189+
177190 static
178191 {
179192 for (Unit unit : Unit .values ())
@@ -200,7 +213,7 @@ public static Unit fromName(@Nullable String unitName)
200213 }
201214
202215 // don't assume multiplicative relation between units (e.g. Kelvin and Celsius)
203- static Function <Double ,Double > convertFn (Unit from , Unit to )
216+ static Function <Double , Double > convertFn (Unit from , Unit to )
204217 {
205218 if (from == to )
206219 return Function .identity ();
@@ -214,7 +227,7 @@ public static double convert(double value, @NotNull Unit from, @NotNull Unit to)
214227 Quantity .LOG .debug ("Converting value {} from {} to {}" , value , from .name (), to .name ());
215228 if (from .base != to .base )
216229 throw new IllegalArgumentException ("Can't convert " + from .name () + " to " + to .name ());
217- return from == to ? value : to .fromBaseUnitValue (from .toBaseUnitValue (value ));
230+ return from == to ? value : to .fromBaseUnitValue (from .toBaseUnitValue (value ));
218231 }
219232
220233 @ Override
0 commit comments