GeomConverter/src/org/lcsim/units/clhep
diff -N SystemOfUnitsMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SystemOfUnitsMap.java 1 Mar 2007 19:06:59 -0000 1.1
@@ -0,0 +1,30 @@
+package org.lcsim.units.clhep;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+
+public class SystemOfUnitsMap
+extends HashMap<String,Double>
+{
+ public SystemOfUnitsMap()
+ {
+ create();
+ }
+
+ private void create()
+ {
+ SystemOfUnits units = new SystemOfUnits();
+ Class<SystemOfUnits> klass = SystemOfUnits.class;
+ Field[] fields = klass.getFields();
+ for (Field f : fields)
+ {
+ try {
+ this.put(f.getName(), f.getDouble(units));
+ }
+ catch ( IllegalAccessException x )
+ {
+ throw new RuntimeException(x);
+ }
+ }
+ }
+}
\ No newline at end of file