Example #1
0
 // static initialization
 static {
   sbmlUnitNames = new HashMap<Integer, String>();
   sbmlUnitKinds = new HashMap<String, Integer>();
   for (int i = 0; i < SBML_UNIT_NAMES.length; i++) {
     String name = SBML_UNIT_NAMES[i];
     Integer code = new Integer(SBML_UNIT_KINDS[i]);
     sbmlUnitNames.put(code, name);
     sbmlUnitKinds.put(name, code);
   }
 }
Example #2
0
 public static int stringToKind(String name) {
   Integer kind = sbmlUnitKinds.get(name);
   return (kind == null) ? libsbmlConstants.UNIT_KIND_INVALID : kind.intValue();
 }
Example #3
0
 // SBML kind/String lookups
 public static String kindToString(int kind) {
   return sbmlUnitNames.get(new Integer(kind));
 }