java.text

Class AttributedCharacterIterator.Attribute

public static class AttributedCharacterIterator.Attribute extends Object implements Serializable

Defines attribute keys that are used as text attributes.
Field Summary
static AttributedCharacterIterator.AttributeINPUT_METHOD_SEGMENT
This is the attribute for input method segments.
static AttributedCharacterIterator.AttributeLANGUAGE
This is the attribute for the language of the text.
static AttributedCharacterIterator.AttributeREADING
This is the attribute for the reading form of text.
Constructor Summary
protected Attribute(String name)
Initializes a new instance of this class with the specified name.
Method Summary
booleanequals(Object obj)
Tests this object for equality against the specified object.
protected StringgetName()
Returns the name of this attribute.
inthashCode()
Returns a hash value for this object.
protected ObjectreadResolve()
Resolves an instance of AttributedCharacterIterator.Attribute that is being deserialized to one of the three pre-defined attribute constants.
StringtoString()
Returns a String representation of this object.

Field Detail

INPUT_METHOD_SEGMENT

public static final AttributedCharacterIterator.Attribute INPUT_METHOD_SEGMENT
This is the attribute for input method segments. The value of attributes of this key type are instances of Annotation which wrapper a String.

LANGUAGE

public static final AttributedCharacterIterator.Attribute LANGUAGE
This is the attribute for the language of the text. The value of attributes of this key type are instances of Locale.

READING

public static final AttributedCharacterIterator.Attribute READING
This is the attribute for the reading form of text. This is used for storing pronunciation along with the written text for languages which need it. The value of attributes of this key type are instances of Annotation which wrappers a String.

Constructor Detail

Attribute

protected Attribute(String name)
Initializes a new instance of this class with the specified name.

Parameters: name The name of this attribute key.

Method Detail

equals

public final boolean equals(Object obj)
Tests this object for equality against the specified object. The two objects will be considered equal if and only if:

Parameters: obj the Object to test for equality against this object.

Returns: true if the specified object is equal to this one, false otherwise.

getName

protected String getName()
Returns the name of this attribute.

Returns: The attribute name

hashCode

public final int hashCode()
Returns a hash value for this object.

Returns: A hash value for this object.

readResolve

protected Object readResolve()
Resolves an instance of AttributedCharacterIterator.Attribute that is being deserialized to one of the three pre-defined attribute constants. It does this by comparing the names of the attributes. The constant that the deserialized object resolves to is returned.

Returns: The resolved contant value

Throws: InvalidObjectException If the object being deserialized cannot be resolved.

toString

public String toString()
Returns a String representation of this object.

Returns: A String representation of this object.