Package java.text
Class AttributedCharacterIterator.Attribute
java.lang.Object
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 keys for text attributes.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static AttributedCharacterIterator.AttributeINPUT_METHOD_SEGMENTThis attribute marks segments from an input method.static AttributedCharacterIterator.AttributeLANGUAGEThe attribute describing the language of a character.static AttributedCharacterIterator.AttributeREADINGFor languages that have different reading directions of text (like Japanese), this attribute allows to define which reading should be used. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(Object object)Compares this attribute with the specified object.protected StringgetName()Returns the name of this attribute.inthashCode()Calculates the hash code for objects of typeAttribute.protected ObjectreadResolve()Resolves a deserialized instance to the correct constant attribute.StringtoString()Returns the name of the class followed by a "(", the name of the attribute, and a ")".
-
Field Details
-
INPUT_METHOD_SEGMENT
This attribute marks segments from an input method. Most input methods create these segments for words. The value objects are of the typeAnnotationwhich containnull. -
LANGUAGE
The attribute describing the language of a character. The value objects are of typeLocaleor a subtype of it. -
READING
For languages that have different reading directions of text (like Japanese), this attribute allows to define which reading should be used. The value objects are of typeAnnotationwhich contain aString.
-
-
Constructor Details
-
Attribute
The constructor for anAttributewith the name passed.- Parameters:
name- the name of the newAttribute.
-
-
Method Details
-
equals
Compares this attribute with the specified object. Checks if both objects are the same instance. It is defined final so all subclasses have the same behavior for this method.- Overrides:
equalsin classObject- Parameters:
object- the object to compare against.- Returns:
trueif the object passed is equal to this instance;falseotherwise.- See Also:
Object.hashCode()
-
getName
Returns the name of this attribute.- Returns:
- the name of this attribute.
-
hashCode
public final int hashCode()Calculates the hash code for objects of typeAttribute. It is defined final so all sub types calculate their hash code identically.- Overrides:
hashCodein classObject- Returns:
- the hash code for this instance of
Attribute. - See Also:
Object.equals(java.lang.Object)
-
readResolve
Resolves a deserialized instance to the correct constant attribute.- Returns:
- the
Attributethis instance represents. - Throws:
InvalidObjectException- if this instance is not of typeAttribute.classor if it is not a knownAttribute.
-
toString
Returns the name of the class followed by a "(", the name of the attribute, and a ")".
-