APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.text

public Class AttributedString

Additional top-level class in compilation unit: AttributeEntry.

extends Object
Class Inheritance
Imports
java.util.*, java.text.AttributedCharacterIterator.Attribute

An AttributedString holds text and related attribute information. It may be used as the actual data storage in some cases where a text reader wants to access attributed text through the AttributedCharacterIterator interface.

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.

Since
1.2
See Also
AttributedCharacterIterator, Annotation

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private static final int
pack-priv Map<AttributedCharacterIterator.Attribute, Object>[]
pack-priv int
pack-priv int[]
pack-priv String

Constructor Summary

AccessConstructor 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.Attribute, ?>
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.Attribute[]
Specifies attributes to be extracted from the text. If null is specified, all available attributes will be used.
attributes
)

Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator.

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(AttributedCharacterIterator.Attribute
the attribute key
attribute
,
Object
the value of the attribute; may be null
value
)

Adds an attribute to the entire string.

public void
addAttribute(AttributedCharacterIterator.Attribute
the attribute key
attribute
,
Object
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.Attribute attribute, Object value, int beginIndex, int endIndex)

private void
addAttributeRunData(AttributedCharacterIterator.Attribute attribute, Object value, int beginRunIndex, int endRunIndex)

public void
addAttributes(Map<? extends AttributedCharacterIterator.Attribute, ?>
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.Attribute> attributes, int runIndex1, int runIndex2)

private char
charAt(int index)

private final void
private final int
ensureRunBreak(int offset)

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.Attribute attribute, int runIndex, int beginIndex, int endIndex)

public AttributedCharacterIterator

Returns:

An iterator providing access to the text and its attributes.
getIterator
()

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 attributes
getIterator
(AttributedCharacterIterator.Attribute[]
a list of attributes that the client is interested in
attributes
)

Creates an AttributedCharacterIterator instance that provides access to selected contents of this string.

public AttributedCharacterIterator

Returns:

an iterator providing access to the text and its attributes
getIterator
(AttributedCharacterIterator.Attribute[]
a list of attributes that the client is interested in
attributes
,
int
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.Attribute, Object> attrs, int offset)

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INITIAL_CAPACITYback to summary
private static final int INITIAL_CAPACITY
runAttributesback to summary
pack-priv Map<AttributedCharacterIterator.Attribute, Object>[] runAttributes
runCountback to summary
pack-priv int runCount
runStartsback to summary
pack-priv int[] runStarts
textback to summary
pack-priv String text

Constructor Detail

AttributedStringback to summary
pack-priv AttributedString(AttributedCharacterIterator[] iterators)

Constructs an AttributedString instance with the given AttributedCharacterIterators.

Parameters
iterators:AttributedCharacterIterator[]

AttributedCharacterIterators to construct AttributedString from.

Exceptions
NullPointerException:
if iterators is null
AttributedStringback to summary
public AttributedString(String text)

Constructs an AttributedString instance with the given text.

Parameters
text:String

The text for this attributed string.

Exceptions
NullPointerException:
if text is null.
AttributedStringback to summary
public AttributedString(String text, Map<? extends AttributedCharacterIterator.Attribute, ?> attributes)

Constructs an AttributedString instance with the given text and attributes.

Parameters
text:String

The text for this attributed string.

attributes:Map<? extends AttributedCharacterIterator.Attribute, ?>

The attributes that apply to the entire string.

Exceptions
NullPointerException:
if text or attributes is null.
IllegalArgumentException:
if the text has length 0 and the attributes parameter is not an empty Map (attributes cannot be applied to a 0-length range).
AttributedStringback to summary
public AttributedString(AttributedCharacterIterator text)

Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator.

Parameters
text:AttributedCharacterIterator

The text for this attributed string.

Exceptions
NullPointerException:
if text is null.
AttributedStringback 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.

Parameters
text:AttributedCharacterIterator

The text for this attributed string.

beginIndex:int

Index of the first character of the range.

endIndex:int

Index of the character following the last character of the range.

Exceptions
NullPointerException:
if text is null.
IllegalArgumentException:
if the subrange given by beginIndex and endIndex is out of the text range.
See Also
java.text.Annotation
AttributedStringback to summary
public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[] attributes)

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.

Parameters
text:AttributedCharacterIterator

The text for this attributed string.

beginIndex:int

Index of the first character of the range.

endIndex:int

Index of the character following the last character of the range.

attributes:AttributedCharacterIterator.Attribute[]

Specifies attributes to be extracted from the text. If null is specified, all available attributes will be used.

Annotations
@SuppressWarnings:this-escape
Exceptions
NullPointerException:
if text is null.
IllegalArgumentException:
if the subrange given by beginIndex and endIndex is out of the text range.
See Also
java.text.Annotation

Method Detail

addAttributeback to summary
public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value)

Adds an attribute to the entire string.

Parameters
attribute:AttributedCharacterIterator.Attribute

the attribute key

value:Object

the value of the attribute; may be null

Exceptions
NullPointerException:
if attribute is null.
IllegalArgumentException:
if the AttributedString has length 0 (attributes cannot be applied to a 0-length range).
addAttributeback to summary
public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value, int beginIndex, int endIndex)

Adds an attribute to a subrange of the string.

Parameters
attribute:AttributedCharacterIterator.Attribute

the attribute key

value:Object

The value of the attribute. May be null.

beginIndex:int

Index of the first character of the range.

endIndex:int

Index of the character following the last character of the range.

Exceptions
NullPointerException:
if attribute is null.
IllegalArgumentException:
if beginIndex is less than 0, endIndex is greater than the length of the string, or beginIndex and endIndex together don't define a non-empty subrange of the string.
addAttributeImplback to summary
private synchronized void addAttributeImpl(AttributedCharacterIterator.Attribute attribute, Object value, int beginIndex, int endIndex)
addAttributeRunDataback to summary
private void addAttributeRunData(AttributedCharacterIterator.Attribute attribute, Object value, int beginRunIndex, int endRunIndex)
addAttributesback to summary
public void addAttributes(Map<? extends AttributedCharacterIterator.Attribute, ?> attributes, int beginIndex, int endIndex)

Adds a set of attributes to a subrange of the string.

Parameters
attributes:Map<? extends AttributedCharacterIterator.Attribute, ?>

The attributes to be added to the string.

beginIndex:int

Index of the first character of the range.

endIndex:int

Index of the character following the last character of the range.

Exceptions
NullPointerException:
if attributes is null.
IllegalArgumentException:
if beginIndex is less than 0, endIndex is greater than the length of the string, or beginIndex and endIndex together don't define a non-empty subrange of the string and the attributes parameter is not an empty Map.
appendContentsback to summary
private final void appendContents(StringBuilder buf, CharacterIterator iterator)

Appends the contents of the CharacterIterator iterator into the StringBuilder buf.

attributeValuesMatchback to summary
private boolean attributeValuesMatch(Set<? extends AttributedCharacterIterator.Attribute> attributes, int runIndex1, int runIndex2)
charAtback to summary
private char charAt(int index)
createRunAttributeDataArraysback to summary
private final void createRunAttributeDataArrays()
ensureRunBreakback to summary
private final int ensureRunBreak(int offset)
ensureRunBreakback 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:

  • If copyAttrs is true, the attributes from the existing run will be placed in both of the newly created runs.
  • If copyAttrs is false, the attributes from the existing run will NOT be copied to the run to the right (>= offset) of the break, but will exist on the run to the left (< offset).
getAttributeback to summary
private synchronized Object getAttribute(AttributedCharacterIterator.Attribute attribute, int runIndex)
getAttributeCheckRangeback to summary
private Object getAttributeCheckRange(AttributedCharacterIterator.Attribute attribute, int runIndex, int beginIndex, int endIndex)
getIteratorback to summary
public AttributedCharacterIterator getIterator()

Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string.

Returns:AttributedCharacterIterator

An iterator providing access to the text and its attributes.

getIteratorback to summary
public AttributedCharacterIterator getIterator(AttributedCharacterIterator.Attribute[] attributes)

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.

Parameters
attributes:AttributedCharacterIterator.Attribute[]

a list of attributes that the client is interested in

Returns:AttributedCharacterIterator

an iterator providing access to the entire text and its selected attributes

getIteratorback to summary
public AttributedCharacterIterator getIterator(AttributedCharacterIterator.Attribute[] attributes, int beginIndex, int endIndex)

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.

Parameters
attributes:AttributedCharacterIterator.Attribute[]

a list of attributes that the client is interested in

beginIndex:int

the index of the first character

endIndex:int

the index of the character following the last character

Returns:AttributedCharacterIterator

an iterator providing access to the text and its attributes

Exceptions
IllegalArgumentException:
if beginIndex is less than 0, endIndex is greater than the length of the string, or beginIndex is greater than endIndex.
lengthback to summary
pack-priv int length()
mapsDifferback 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.

setAttributesback to summary
private void setAttributes(Map<AttributedCharacterIterator.Attribute, Object> attrs, int offset)

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!

java.text back to summary

private final Class AttributedString.AttributedStringIterator

extends Object
implements AttributedCharacterIterator
Class Inheritance
All Implemented Interfaces
java.text.AttributedCharacterIterator, java.text.CharacterIterator, java.lang.Cloneable

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private int
private int
private AttributedCharacterIterator.Attribute[]

Constructor Summary

AccessConstructor and Description
pack-priv
AttributedStringIterator(AttributedCharacterIterator.Attribute[] attributes, int beginIndex, int endIndex)

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Create a copy of this iterator

public char
current()

Implements java.text.CharacterIterator.current.

Gets the character at the current position (as returned by getIndex()).

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public char
first()

Implements java.text.CharacterIterator.first.

Sets the position to getBeginIndex() and returns the character at that position.

public Set<AttributedCharacterIterator.Attribute>
getAllAttributeKeys()

Implements java.text.AttributedCharacterIterator.getAllAttributeKeys.

Returns the keys of all attributes defined on the iterator's text range.

public Object
getAttribute(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getAttribute.

Returns the value of the named attribute for the current character.

public Map<AttributedCharacterIterator.Attribute, Object>
getAttributes()

Implements java.text.AttributedCharacterIterator.getAttributes.

Returns a map with the attributes defined on the current character.

public int
getBeginIndex()

Implements java.text.CharacterIterator.getBeginIndex.

Returns the start index of the text.

public int
getEndIndex()

Implements java.text.CharacterIterator.getEndIndex.

Returns the end index of the text.

public int
getIndex()

Implements java.text.CharacterIterator.getIndex.

Returns the current index.

public int
getRunLimit()

Implements java.text.AttributedCharacterIterator.getRunLimit.

Returns the index of the first character following the run with respect to all attributes containing the current character.

public int
getRunLimit(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getRunLimit.

Returns the index of the first character following the run with respect to the given attribute containing the current character.

public int
getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Implements java.text.AttributedCharacterIterator.getRunLimit.

Returns the index of the first character following the run with respect to the given attributes containing the current character.

public int
getRunStart()

Implements java.text.AttributedCharacterIterator.getRunStart.

Returns the index of the first character of the run with respect to all attributes containing the current character.

public int
getRunStart(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getRunStart.

Returns the index of the first character of the run with respect to the given attribute containing the current character.

public int
getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Implements java.text.AttributedCharacterIterator.getRunStart.

Returns the index of the first character of the run with respect to the given attributes containing the current character.

private AttributedString
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private char
internalSetIndex(int position)

public char
last()

Implements java.text.CharacterIterator.last.

Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position.

public char
next()

Implements java.text.CharacterIterator.next.

Increments the iterator's index by one and returns the character at the new index.

public char
previous()

Implements java.text.CharacterIterator.previous.

Decrements the iterator's index by one and returns the character at the new index.

public char
setIndex(int position)

Implements java.text.CharacterIterator.setIndex.

Sets the position to the specified position in the text and returns that character.

private void
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

beginIndexback to summary
private int beginIndex
currentIndexback to summary
private int currentIndex
currentRunIndexback to summary
private int currentRunIndex
currentRunLimitback to summary
private int currentRunLimit
currentRunStartback to summary
private int currentRunStart
endIndexback to summary
private int endIndex
relevantAttributesback to summary
private AttributedCharacterIterator.Attribute[] relevantAttributes

Constructor Detail

AttributedStringIteratorback to summary
pack-priv AttributedStringIterator(AttributedCharacterIterator.Attribute[] attributes, int beginIndex, int endIndex)

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Doc from java.text.CharacterIterator.clone.

Create a copy of this iterator

currentback to summary
public char current()

Implements java.text.CharacterIterator.current.

Doc from java.text.CharacterIterator.current.

Gets the character at the current position (as returned by getIndex()).

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

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.

Annotations
@Override
firstback to summary
public char first()

Implements java.text.CharacterIterator.first.

Doc from java.text.CharacterIterator.first.

Sets the position to getBeginIndex() and returns the character at that position.

getAllAttributeKeysback to summary
public Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()

Implements java.text.AttributedCharacterIterator.getAllAttributeKeys.

Doc from java.text.AttributedCharacterIterator.getAllAttributeKeys.

Returns the keys of all attributes defined on the iterator's text range. The set is empty if no attributes are defined.

getAttributeback to summary
public Object getAttribute(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getAttribute.

Doc from java.text.AttributedCharacterIterator.getAttribute.

Returns the value of the named attribute for the current character. Returns null if the attribute is not defined.

getAttributesback to summary
public Map<AttributedCharacterIterator.Attribute, Object> getAttributes()

Implements java.text.AttributedCharacterIterator.getAttributes.

Doc from java.text.AttributedCharacterIterator.getAttributes.

Returns a map with the attributes defined on the current character.

getBeginIndexback to summary
public int getBeginIndex()

Implements java.text.CharacterIterator.getBeginIndex.

Doc from java.text.CharacterIterator.getBeginIndex.

Returns the start index of the text.

getEndIndexback to summary
public int getEndIndex()

Implements java.text.CharacterIterator.getEndIndex.

Doc from java.text.CharacterIterator.getEndIndex.

Returns the end index of the text. This index is the index of the first character following the end of the text.

getIndexback to summary
public int getIndex()

Implements java.text.CharacterIterator.getIndex.

Doc from java.text.CharacterIterator.getIndex.

Returns the current index.

getRunLimitback to summary
public int getRunLimit()

Implements java.text.AttributedCharacterIterator.getRunLimit.

Doc from java.text.AttributedCharacterIterator.getRunLimit.

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.

getRunLimitback to summary
public int getRunLimit(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getRunLimit.

Doc from java.text.AttributedCharacterIterator.getRunLimit.

Returns the index of the first character following the run with respect to the given attribute containing the current character.

getRunLimitback to summary
public int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Implements java.text.AttributedCharacterIterator.getRunLimit.

Doc from java.text.AttributedCharacterIterator.getRunLimit.

Returns the index of the first character following the run with respect to the given attributes containing the current character.

getRunStartback to summary
public int getRunStart()

Implements java.text.AttributedCharacterIterator.getRunStart.

Doc from java.text.AttributedCharacterIterator.getRunStart.

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.

getRunStartback to summary
public int getRunStart(AttributedCharacterIterator.Attribute attribute)

Implements java.text.AttributedCharacterIterator.getRunStart.

Doc from java.text.AttributedCharacterIterator.getRunStart.

Returns the index of the first character of the run with respect to the given attribute containing the current character.

getRunStartback to summary
public int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Implements java.text.AttributedCharacterIterator.getRunStart.

Doc from java.text.AttributedCharacterIterator.getRunStart.

Returns the index of the first character of the run with respect to the given attributes containing the current character.

getStringback to summary
private AttributedString getString()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
internalSetIndexback to summary
private char internalSetIndex(int position)
lastback to summary
public char last()

Implements java.text.CharacterIterator.last.

Doc from java.text.CharacterIterator.last.

Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position.

nextback to summary
public char next()

Implements java.text.CharacterIterator.next.

Doc from java.text.CharacterIterator.next.

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.

previousback to summary
public char previous()

Implements java.text.CharacterIterator.previous.

Doc from java.text.CharacterIterator.previous.

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.

setIndexback to summary
public char setIndex(int position)

Implements java.text.CharacterIterator.setIndex.

Doc from java.text.CharacterIterator.setIndex.

Sets the position to the specified position in the text and returns that character.

updateRunInfoback to summary
private void updateRunInfo()
java.text back to summary

private final Class AttributedString.AttributeMap

extends AbstractMap<AttributedCharacterIterator.Attribute, Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
AttributeMap(int runIndex, int beginIndex, int endIndex)

Method Summary

Modifier and TypeMethod and Description
public Set<Map.Entry<AttributedCharacterIterator.Attribute, Object>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public Object
get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Inherited from java.util.AbstractMap:
clearclonecontainsKeycontainsValueequalshashCodeisEmptykeySetputputAllremovesizetoStringvalues

Field Detail

beginIndexback to summary
pack-priv int beginIndex
endIndexback to summary
pack-priv int endIndex
runIndexback to summary
pack-priv int runIndex

Constructor Detail

AttributeMapback to summary
pack-priv AttributeMap(int runIndex, int beginIndex, int endIndex)

Method Detail

entrySetback to summary
public Set<Map.Entry<AttributedCharacterIterator.Attribute, Object>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

getback to summary
public Object get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.AbstractMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.