APIdia Launch Partner
Top Description Fields Constructors Methods
java.text

public Class Annotation

extends Object
Class Inheritance

An Annotation object is used as a wrapper for a text attribute value if the attribute has annotation characteristics. These characteristics are: An example is grammatical information attached to a sentence: For the previous sentence, you can say that "an example" is the subject, but you cannot say the same about "an", "example", or "exam". When the text is changed, the grammatical information typically becomes invalid. Another example is Japanese reading information (yomi).

Wrapping the attribute value into an Annotation object guarantees that adjacent text runs don't get merged even if the attribute values are equal, and indicates to text containers that the attribute should be discarded if the underlying text is modified.

Since
1.2
See Also
AttributedCharacterIterator

Field Summary

Modifier and TypeField and Description
private Object

Constructor Summary

AccessConstructor and Description
public
Annotation(Object
the value of the attribute
value
)

Constructs an annotation record with the given value, which may be null.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the value of the attribute
getValue
()

Returns the value of the attribute, which may be null.

public String

Returns:

the String representation of this Annotation
toString
()

Overrides java.lang.Object.toString.

Returns the String representation of this Annotation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

valueback to summary
private Object value

Constructor Detail

Annotationback to summary
public Annotation(Object value)

Constructs an annotation record with the given value, which may be null.

Parameters
value:Object

the value of the attribute

Method Detail

getValueback to summary
public Object getValue()

Returns the value of the attribute, which may be null.

Returns:Object

the value of the attribute

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the String representation of this Annotation.

Returns:String

the String representation of this Annotation