1 7 8 package java.awt; 9 10 import sun.awt.DebugHelper; 11 12 abstract class AttributeValue { 13 private final int value; 14 private final String [] names; 15 16 private static final DebugHelper dbg = 17 DebugHelper.create(AttributeValue .class); 18 19 protected AttributeValue(int value, String [] names) { 20 if (dbg.on) { 21 dbg.assertion(value >= 0 && names != null && value < names.length); 22 } 23 this.value = value; 24 this.names = names; 25 } 26 public int hashCode() { 29 return value; 30 } 31 public String toString() { 32 return names[value]; 33 } 34 } 35 | Popular Tags |