java.awt
Class AttributeValue

java.lang.Object
java.awt.AttributeValue
- Direct Known Subclasses:
- BufferCapabilities.FlipContents, JobAttributes.DefaultSelectionType, JobAttributes.DestinationType, JobAttributes.DialogType, JobAttributes.MultipleDocumentHandlingType, JobAttributes.SidesType, PageAttributes.ColorType, PageAttributes.MediaType, PageAttributes.OrientationRequestedType, PageAttributes.OriginType, PageAttributes.PrintQualityType
- class AttributeValue
- extends java.lang.Object
This class is undocumented by Sun, but it is the parent of several other
classes, all of which are type-safe enumerations. This takes care of
equals, toString, and hashCode, so
that you don't have to (although hashCode is commonly overridden).
|
Field Summary |
private java.lang.String[] |
names
The list of enumeration names for the given subclass. |
(package private) int |
value
The value of the enumeration. |
value
final int value
- The value of the enumeration. Package visible for speed.
names
private final java.lang.String[] names
- The list of enumeration names for the given subclass.
AttributeValue
AttributeValue(int value,
java.lang.String[] names)
- Construct a type-safe enumeration element. For example,
class Foo extends AttributeValue
{
private static final String[] names = { "one", "two" }
public static final Foo ONE = new Foo(0);
public static final Foo TWO = new Foo(1);
private Foo(int value) { super(value, names); }
}
hashCode
public int hashCode()
- Returns the hashcode of this element. This is the index of the element
in the enumeration. Note that equals defaults to the == relation.
toString
public java.lang.String toString()
- Returns the name of this enumeration element.