MConstText is a base class for text with multiple character and
paragraph styles. The text is a sequence of Unicode characters,
represented by char . Character and paragraph
styles are represented by the AttributeMap class.
Characters in the text are accessed with an integer index using the
at method.
Valid indices are between 0 and (length-1), where length is the number
of characters in the text. Additionally, the
characters in the text may be accessed through a
java.text.CharacterIterator .
Every character in the text has a character style associated with it,
represented by the AttributeMap class. The character
style for a particular character can be obtained using the
characterStyleAt method.
Each character in the text is contained in a paragraph. A paragraph
is a range of text including and terminated by a
paragraph separator (either \n or U+2029 ).
Every
paragraph has a paragraph style associated with it, represented
by the AttributeMap class. Paragraph boundaries and
styles can be obtained from the MConstText.
This class does not have methods for modifying the text or styles.
However, subclasses may add this capability, so it is not safe to
assume that an MConstText instance is immutable. In particular,
the MText class adds modification protocol to this class. Clients
can detect whether an MConstText has changed by keeping track of its
timestamp.
A DataFlavor for clipboard content is defined in this class. Using
this DataFlavor insures that all clients will recognize MConstText
content on the clipboard.
See Also: MText See Also: AttributeMap See Also: java.text.CharacterIterator See Also: java.awt.datatransfer.DataFlavor |