java.text
Class AttributedCharacterIterator.Attribute

java.lang.Object
  extended by java.text.AttributedCharacterIterator.Attribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Format.Field, TextAttribute
Enclosing interface:
AttributedCharacterIterator

public static class AttributedCharacterIterator.Attribute
extends Object
implements Serializable

Defines attribute keys that are used as text attributes.

See Also:
Serialized Form

Field Summary
static AttributedCharacterIterator.Attribute INPUT_METHOD_SEGMENT
          This is the attribute for input method segments.
static AttributedCharacterIterator.Attribute LANGUAGE
          This is the attribute for the language of the text.
static AttributedCharacterIterator.Attribute READING
          This is the attribute for the reading form of text.
 
Constructor Summary
protected AttributedCharacterIterator.Attribute(String name)
          Initializes a new instance of this class with the specified name.
 
Method Summary
 boolean equals(Object obj)
          Tests this object for equality against the specified object.
protected  String getName()
          Returns the name of this attribute.
 int hashCode()
          Returns a hash value for this object.
protected  Object readResolve()
          Resolves an instance of AttributedCharacterIterator.Attribute that is being deserialized to one of the three pre-defined attribute constants.
 String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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.


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.

Constructor Detail

AttributedCharacterIterator.Attribute

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

Parameters:
name - The name of this attribute key.
Method Detail

getName

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

Returns:
The attribute name

readResolve

protected Object readResolve()
                      throws InvalidObjectException
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.

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:

Overrides:
equals in class Object
Parameters:
obj - the Object to test for equality against this object.
Returns:
true if the specified object is equal to this one, false otherwise.
See Also:
Object.hashCode()

hashCode

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

Overrides:
hashCode in class Object
Returns:
A hash value for this object.
See Also:
Object.equals(Object), System.identityHashCode(Object)

toString

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

Overrides:
toString in class Object
Returns:
A String representation of this object.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)