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 Details

    • INPUT_METHOD_SEGMENT

      public static final AttributedCharacterIterator.Attribute 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 type Annotation which contain null.
    • LANGUAGE

      public static final AttributedCharacterIterator.Attribute LANGUAGE
      The attribute describing the language of a character. The value objects are of type Locale or a subtype of it.
    • READING

      public static final AttributedCharacterIterator.Attribute 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 type Annotation which contain a String.
  • Constructor Details

    • Attribute

      protected Attribute​(String name)
      The constructor for an Attribute with the name passed.
      Parameters:
      name - the name of the new Attribute.
  • Method Details

    • equals

      public final boolean equals​(Object object)
      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:
      equals in class Object
      Parameters:
      object - the object to compare against.
      Returns:
      true if the object passed is equal to this instance; false otherwise.
      See Also:
      Object.hashCode()
    • getName

      protected String 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 type Attribute. It is defined final so all sub types calculate their hash code identically.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this instance of Attribute.
      See Also:
      Object.equals(java.lang.Object)
    • readResolve

      protected Object readResolve() throws InvalidObjectException
      Resolves a deserialized instance to the correct constant attribute.
      Returns:
      the Attribute this instance represents.
      Throws:
      InvalidObjectException - if this instance is not of type Attribute.class or if it is not a known Attribute.
    • toString

      public String toString()
      Returns the name of the class followed by a "(", the name of the attribute, and a ")".
      Overrides:
      toString in class Object
      Returns:
      the string representing this instance.