/** * Creates an enumeration, with an array of values, and freezes it. */ public EnumeratedValues(V[] values) { for (V value : values) { register(value); } makeImmutable(); }
/** * Create an enumeration, initializes it with arrays of code/name pairs, * and freezes it. */ public EnumeratedValues(String[] names, int[] codes, String[] descriptions) { for (int i = 0; i < names.length; i++) { register((V) new BasicValue(names[i], codes[i], descriptions[i])); } makeImmutable(); }
/** * Creates an enumeration, initialize it with an array of strings, and * freezes it. */ public EnumeratedValues(String[] names) { for (int i = 0; i < names.length; i++) { register((V) new BasicValue(names[i], i, names[i])); } makeImmutable(); }
/** * Create an enumeration, initializes it with arrays of code/name pairs, * and freezes it. */ public EnumeratedValues(String[] names, int[] codes) { for (int i = 0; i < names.length; i++) { register((V) new BasicValue(names[i], codes[i], names[i])); } makeImmutable(); }