Additional top-level class in compilation unit: AttributeEntry.
An attribute is a key/value pair, identified by the key. No two attributes on a given character can have the same key.
The values for an attribute are immutable, or must not be mutated by clients or storage. They are always passed by reference, and not cloned.
AttributedCharacterIterator, Annotation
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv Map | |
| pack-priv int | |
| pack-priv int[] | |
| pack-priv String |
| Access | Constructor and Description |
|---|---|
| pack-priv | AttributedString(AttributedCharacterIterator[]
AttributedCharacterIterators to construct
AttributedString from. iterators)Constructs an AttributedString instance with the given AttributedCharacterIterators. |
| public | AttributedString(String
The text for this attributed string. text)Constructs an AttributedString instance with the given text. |
| public | AttributedString(String
The text for this attributed string. text, Map<? extends AttributedCharacterIterator.The attributes that apply to the entire string. attributes)Constructs an AttributedString instance with the given text and attributes. |
| public | AttributedString(AttributedCharacterIterator
The text for this attributed string. text)Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator. |
| public | AttributedString(AttributedCharacterIterator
The text for this attributed string. text, int Index of the first character of the range. beginIndex, int Index of the character following the last character
of the range. endIndex)Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. |
| public | AttributedString(AttributedCharacterIterator
The text for this attributed string. text, int Index of the first character of the range. beginIndex, int Index of the character following the last character
of the range. endIndex, AttributedCharacterIterator.Specifies attributes to be extracted
from the text. If null is specified, all available attributes will
be used. attributesConstructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAttribute(AttributedCharacterIterator.
the attribute key attribute,the value of the attribute; may be null value)Adds an attribute to the entire string. |
| public void | addAttribute(AttributedCharacterIterator.
the attribute key attribute,The value of the attribute. May be null. value, int Index of the first character of the range. beginIndex, int Index of the character following the last character of the range. endIndex)Adds an attribute to a subrange of the string. |
| private synchronized void | addAttributeImpl(AttributedCharacterIterator.
|
| private void | addAttributeRunData(AttributedCharacterIterator.
|
| public void | addAttributes(Map<? extends AttributedCharacterIterator.
The attributes to be added to the string. attributes, int Index of the first character of the range. beginIndex, int Index of the character following the last
character of the range. endIndex)Adds a set of attributes to a subrange of the string. |
| private final void | appendContents(StringBuilder buf, CharacterIterator iterator)
Appends the contents of the CharacterIterator iterator into the StringBuilder buf. |
| private boolean | attributeValuesMatch(Set<? extends AttributedCharacterIterator.
|
| private char | |
| private final void | |
| private final int | |
| private final int | ensureRunBreak(int offset, boolean copyAttrs)
Ensures there is a run break at offset, returning the index of the run. |
| private synchronized Object | |
| private Object | getAttributeCheckRange(AttributedCharacterIterator.
|
| public AttributedCharacterIterator | Returns: An iterator providing access to the text and its attributes.Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string. |
| public AttributedCharacterIterator | Returns: an iterator providing access to the entire text and its selected attributesa list of attributes that the client is interested in attributesCreates an AttributedCharacterIterator instance that provides access to selected contents of this string. |
| public AttributedCharacterIterator | Returns: an iterator providing access to the text and its attributesa list of attributes that the client is interested in attributes,the index of the first character beginIndex, int the index of the character following the last character endIndex)Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. |
| pack-priv int | |
| private static <K, V> boolean | mapsDiffer(Map<K, V> last, Map<K, V> attrs)
Returns true if the attributes specified in last and attrs differ. |
| private void | setAttributes(Map<AttributedCharacterIterator.
Sets the attributes for the range from offset to the next run break (typically the end of the text) to the ones specified in attrs. |
| INITIAL_CAPACITY | back to summary |
|---|---|
| private static final int INITIAL_CAPACITY | |
| runAttributes | back to summary |
|---|---|
| pack-priv Map<AttributedCharacterIterator. | |
| runCount | back to summary |
|---|---|
| pack-priv int runCount | |
| runStarts | back to summary |
|---|---|
| pack-priv int[] runStarts | |
| text | back to summary |
|---|---|
| pack-priv String text | |
| AttributedString | back to summary |
|---|---|
| pack-priv AttributedString(AttributedCharacterIterator[] iterators) Constructs an AttributedString instance with the given AttributedCharacterIterators.
| |
| AttributedString | back to summary |
|---|---|
| public AttributedString(String text) Constructs an AttributedString instance with the given text.
| |
| AttributedString | back to summary |
|---|---|
| public AttributedString(String text, Map<? extends AttributedCharacterIterator. Constructs an AttributedString instance with the given text and attributes.
| |
| AttributedString | back to summary |
|---|---|
| public AttributedString(AttributedCharacterIterator text) Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator.
| |
| AttributedString | back to summary |
|---|---|
| public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex) Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. If the given range produces an empty text, all attributes will be discarded. Note that any attributes wrapped by an Annotation object are discarded for a subrange of the original attribute range.
| |
| AttributedString | back to summary |
|---|---|
| public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, AttributedCharacterIterator. Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. Only attributes that match the given attributes will be incorporated into the instance. If the given range produces an empty text, all attributes will be discarded. Note that any attributes wrapped by an Annotation object are discarded for a subrange of the original attribute range.
| |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(AttributedCharacterIterator. Adds an attribute to the entire string.
| |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(AttributedCharacterIterator. Adds an attribute to a subrange of the string.
| |
| addAttributeImpl | back to summary |
|---|---|
| private synchronized void addAttributeImpl(AttributedCharacterIterator. | |
| addAttributeRunData | back to summary |
|---|---|
| private void addAttributeRunData(AttributedCharacterIterator. | |
| addAttributes | back to summary |
|---|---|
| public void addAttributes(Map<? extends AttributedCharacterIterator. Adds a set of attributes to a subrange of the string.
| |
| appendContents | back to summary |
|---|---|
| private final void appendContents(StringBuilder buf, CharacterIterator iterator) Appends the contents of the CharacterIterator iterator into the StringBuilder buf. | |
| attributeValuesMatch | back to summary |
|---|---|
| private boolean attributeValuesMatch(Set<? extends AttributedCharacterIterator. | |
| charAt | back to summary |
|---|---|
| private char charAt(int index) | |
| createRunAttributeDataArrays | back to summary |
|---|---|
| private final void createRunAttributeDataArrays() | |
| ensureRunBreak | back to summary |
|---|---|
| private final int ensureRunBreak(int offset) | |
| ensureRunBreak | back to summary |
|---|---|
| private final int ensureRunBreak(int offset, boolean copyAttrs) Ensures there is a run break at offset, returning the index of the run. If this results in splitting a run, two things can happen:
| |
| getAttribute | back to summary |
|---|---|
| private synchronized Object getAttribute(AttributedCharacterIterator. | |
| getAttributeCheckRange | back to summary |
|---|---|
| private Object getAttributeCheckRange(AttributedCharacterIterator. | |
| getIterator | back to summary |
|---|---|
| public AttributedCharacterIterator getIterator() Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string.
| |
| getIterator | back to summary |
|---|---|
| public AttributedCharacterIterator getIterator(AttributedCharacterIterator. Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
| |
| getIterator | back to summary |
|---|---|
| public AttributedCharacterIterator getIterator(AttributedCharacterIterator. Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
| |
| length | back to summary |
|---|---|
| pack-priv int length() | |
| mapsDiffer | back to summary |
|---|---|
| private static <K, V> boolean mapsDiffer(Map<K, V> last, Map<K, V> attrs) Returns true if the attributes specified in last and attrs differ. | |
| setAttributes | back to summary |
|---|---|
| private void setAttributes(Map<AttributedCharacterIterator. Sets the attributes for the range from offset to the next run break (typically the end of the text) to the ones specified in attrs. This is only meant to be called from the constructor! | |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private AttributedCharacterIterator. |
| Access | Constructor and Description |
|---|---|
| pack-priv | AttributedStringIterator(AttributedCharacterIterator.
|
| Modifier and Type | Method and Description |
|---|---|
| public Object | clone()
Overrides java. Implements java. Create a copy of this iterator |
| public char | current()
Implements java. Gets the character at the current position (as returned by getIndex()). |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public char | first()
Implements java. Sets the position to getBeginIndex() and returns the character at that position. |
| public Set | getAllAttributeKeys()
Implements java. Returns the keys of all attributes defined on the iterator's text range. |
| public Object | getAttribute(AttributedCharacterIterator.
Implements java. Returns the value of the named |
| public Map | getAttributes()
Implements java. Returns a map with the attributes defined on the current character. |
| public int | getBeginIndex()
Implements java. Returns the start index of the text. |
| public int | |
| public int | |
| public int | getRunLimit()
Implements java. Returns the index of the first character following the run with respect to all attributes containing the current character. |
| public int | getRunLimit(AttributedCharacterIterator.
Implements java. Returns the index of the first character following the run
with respect to the given |
| public int | getRunLimit(Set<? extends AttributedCharacterIterator.
Implements java. Returns the index of the first character following the run
with respect to the given |
| public int | getRunStart()
Implements java. Returns the index of the first character of the run with respect to all attributes containing the current character. |
| public int | getRunStart(AttributedCharacterIterator.
Implements java. Returns the index of the first character of the run
with respect to the given |
| public int | getRunStart(Set<? extends AttributedCharacterIterator.
Implements java. Returns the index of the first character of the run
with respect to the given |
| private AttributedString | |
| public int | |
| private char | |
| public char | last()
Implements java. Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position. |
| public char | next()
Implements java. Increments the iterator's index by one and returns the character at the new index. |
| public char | previous()
Implements java. Decrements the iterator's index by one and returns the character at the new index. |
| public char | setIndex(int position)
Implements java. Sets the position to the specified position in the text and returns that character. |
| private void |
| beginIndex | back to summary |
|---|---|
| private int beginIndex | |
| currentIndex | back to summary |
|---|---|
| private int currentIndex | |
| currentRunIndex | back to summary |
|---|---|
| private int currentRunIndex | |
| currentRunLimit | back to summary |
|---|---|
| private int currentRunLimit | |
| currentRunStart | back to summary |
|---|---|
| private int currentRunStart | |
| endIndex | back to summary |
|---|---|
| private int endIndex | |
| relevantAttributes | back to summary |
|---|---|
| private AttributedCharacterIterator. | |
| AttributedStringIterator | back to summary |
|---|---|
| pack-priv AttributedStringIterator(AttributedCharacterIterator. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements java. Doc from java. Create a copy of this iterator | |
| current | back to summary |
|---|---|
| public char current() Implements java. Doc from java. Gets the character at the current position (as returned by getIndex()). | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| first | back to summary |
|---|---|
| public char first() Implements java. Doc from java. Sets the position to getBeginIndex() and returns the character at that position. | |
| getAllAttributeKeys | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns the keys of all attributes defined on the iterator's text range. The set is empty if no attributes are defined. | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(AttributedCharacterIterator. Implements java. Doc from java. Returns the value of the named | |
| getAttributes | back to summary |
|---|---|
| public Map Implements java. Doc from java. Returns a map with the attributes defined on the current character. | |
| getBeginIndex | back to summary |
|---|---|
| public int getBeginIndex() Implements java. Doc from java. Returns the start index of the text. | |
| getEndIndex | back to summary |
|---|---|
| public int getEndIndex() Implements java. Doc from java. Returns the end index of the text. This index is the index of the first character following the end of the text. | |
| getIndex | back to summary |
|---|---|
| public int getIndex() Implements java. Doc from java. Returns the current index. | |
| getRunLimit | back to summary |
|---|---|
| public int getRunLimit() Implements java. Doc from java. Returns the index of the first character following the run with respect to all attributes containing the current character. Any contiguous text segments having the same attributes (the same set of attribute/value pairs) are treated as separate runs if the attributes have been given to those text segments separately. | |
| getRunLimit | back to summary |
|---|---|
| public int getRunLimit(AttributedCharacterIterator. Implements java. Doc from java. Returns the index of the first character following the run
with respect to the given | |
| getRunLimit | back to summary |
|---|---|
| public int getRunLimit(Set<? extends AttributedCharacterIterator. Implements java. Doc from java. Returns the index of the first character following the run
with respect to the given | |
| getRunStart | back to summary |
|---|---|
| public int getRunStart() Implements java. Doc from java. Returns the index of the first character of the run with respect to all attributes containing the current character. Any contiguous text segments having the same attributes (the same set of attribute/value pairs) are treated as separate runs if the attributes have been given to those text segments separately. | |
| getRunStart | back to summary |
|---|---|
| public int getRunStart(AttributedCharacterIterator. Implements java. Doc from java. Returns the index of the first character of the run
with respect to the given | |
| getRunStart | back to summary |
|---|---|
| public int getRunStart(Set<? extends AttributedCharacterIterator. Implements java. Doc from java. Returns the index of the first character of the run
with respect to the given | |
| getString | back to summary |
|---|---|
| private AttributedString getString() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| internalSetIndex | back to summary |
|---|---|
| private char internalSetIndex(int position) | |
| last | back to summary |
|---|---|
| public char last() Implements java. Doc from java. Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position. | |
| next | back to summary |
|---|---|
| public char next() Implements java. Doc from java. Increments the iterator's index by one and returns the character at the new index. If the resulting index is greater or equal to getEndIndex(), the current index is reset to getEndIndex() and a value of DONE is returned. | |
| previous | back to summary |
|---|---|
| public char previous() Implements java. Doc from java. Decrements the iterator's index by one and returns the character at the new index. If the current index is getBeginIndex(), the index remains at getBeginIndex() and a value of DONE is returned. | |
| setIndex | back to summary |
|---|---|
| public char setIndex(int position) Implements java. Doc from java. Sets the position to the specified position in the text and returns that character. | |
| updateRunInfo | back to summary |
|---|---|
| private void updateRunInfo() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| public Object | get(Object key)
Overrides java. Implements java. Returns the value to which the specified key is mapped,
or |
| beginIndex | back to summary |
|---|---|
| pack-priv int beginIndex | |
| endIndex | back to summary |
|---|---|
| pack-priv int endIndex | |
| runIndex | back to summary |
|---|---|
| pack-priv int runIndex | |
| AttributeMap | back to summary |
|---|---|
| pack-priv AttributeMap(int runIndex, int beginIndex, int endIndex) | |
| entrySet | back to summary |
|---|---|
| public Set Implements abstract java. Implements java. Doc from java. Returns a | |
| get | back to summary |
|---|---|
| public Object get(Object key) Overrides java. Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |