|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.text.AttributedString.AttributedStringIterator
Nested Class Summary |
Nested classes inherited from class java.text.AttributedCharacterIterator |
AttributedCharacterIterator.Attribute |
Field Summary | |
private int |
beginIndex
|
private int |
currentIndex
|
private int |
currentRunIndex
|
private int |
currentRunLimit
|
private int |
currentRunStart
|
private int |
endIndex
|
private AttributedCharacterIterator.Attribute[] |
relevantAttributes
|
Fields inherited from interface java.text.CharacterIterator |
DONE |
Constructor Summary | |
(package private) |
AttributedString.AttributedStringIterator(AttributedCharacterIterator.Attribute[] attributes,
int beginIndex,
int endIndex)
|
Method Summary | |
Object |
clone()
Create a copy of this iterator |
char |
current()
Gets the character at the current position (as returned by getIndex()). |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
char |
first()
Sets the position to getBeginIndex() and returns the character at that position. |
Set |
getAllAttributeKeys()
Returns the keys of all attributes defined on the iterator's text range. |
Object |
getAttribute(AttributedCharacterIterator.Attribute attribute)
Returns the value of the named attribute for the current character. |
Map |
getAttributes()
Returns a map with the attributes defined on the current character. |
int |
getBeginIndex()
Returns the start index of the text. |
int |
getEndIndex()
Returns the end index of the text. |
int |
getIndex()
Returns the current index. |
int |
getRunLimit()
Returns the index of the first character following the run with respect to all attributes containing the current character. |
int |
getRunLimit(AttributedCharacterIterator.Attribute attribute)
Returns the index of the first character following the run with respect to the given attribute containing the current character. |
int |
getRunLimit(Set attributes)
Returns the index of the first character following the run with respect to the given attributes containing the current character. |
int |
getRunStart()
Returns the index of the first character of the run with respect to all attributes containing the current character. |
int |
getRunStart(AttributedCharacterIterator.Attribute attribute)
Returns the index of the first character of the run with respect to the given attribute containing the current character. |
int |
getRunStart(Set attributes)
Returns the index of the first character of the run with respect to the given attributes containing the current character. |
private AttributedString |
getString()
|
int |
hashCode()
Returns a hash code value for the object. |
private char |
internalSetIndex(int position)
|
char |
last()
Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position. |
char |
next()
Increments the iterator's index by one and returns the character at the new index. |
char |
previous()
Decrements the iterator's index by one and returns the character at the new index. |
char |
setIndex(int position)
Sets the position to the specified position in the text and returns that character. |
private void |
updateRunInfo()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int beginIndex
private int endIndex
private AttributedCharacterIterator.Attribute[] relevantAttributes
private int currentIndex
private int currentRunIndex
private int currentRunStart
private int currentRunLimit
Constructor Detail |
AttributedString.AttributedStringIterator(AttributedCharacterIterator.Attribute[] attributes, int beginIndex, int endIndex)
Method Detail |
public boolean equals(Object obj)
Object
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
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.
x
,
x.equals(null)
should return false
.
The equals method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
equals
in class Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
Hashtable
public int hashCode()
Object
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
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 hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public Object clone()
CharacterIterator
clone
in interface CharacterIterator
clone
in class Object
Cloneable
public char first()
CharacterIterator
first
in interface CharacterIterator
CharacterIterator.getBeginIndex()
public char last()
CharacterIterator
last
in interface CharacterIterator
CharacterIterator.getEndIndex()
public char current()
CharacterIterator
current
in interface CharacterIterator
CharacterIterator.getIndex()
public char next()
CharacterIterator
next
in interface CharacterIterator
public char previous()
CharacterIterator
previous
in interface CharacterIterator
public char setIndex(int position)
CharacterIterator
setIndex
in interface CharacterIterator
position
- the position within the text. Valid values range from
getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown
if an invalid value is supplied.
public int getBeginIndex()
CharacterIterator
getBeginIndex
in interface CharacterIterator
public int getEndIndex()
CharacterIterator
getEndIndex
in interface CharacterIterator
public int getIndex()
CharacterIterator
getIndex
in interface CharacterIterator
public int getRunStart()
AttributedCharacterIterator
getRunStart
in interface AttributedCharacterIterator
public int getRunStart(AttributedCharacterIterator.Attribute attribute)
AttributedCharacterIterator
getRunStart
in interface AttributedCharacterIterator
public int getRunStart(Set attributes)
AttributedCharacterIterator
getRunStart
in interface AttributedCharacterIterator
public int getRunLimit()
AttributedCharacterIterator
getRunLimit
in interface AttributedCharacterIterator
public int getRunLimit(AttributedCharacterIterator.Attribute attribute)
AttributedCharacterIterator
getRunLimit
in interface AttributedCharacterIterator
public int getRunLimit(Set attributes)
AttributedCharacterIterator
getRunLimit
in interface AttributedCharacterIterator
public Map getAttributes()
AttributedCharacterIterator
getAttributes
in interface AttributedCharacterIterator
public Set getAllAttributeKeys()
AttributedCharacterIterator
getAllAttributeKeys
in interface AttributedCharacterIterator
public Object getAttribute(AttributedCharacterIterator.Attribute attribute)
AttributedCharacterIterator
getAttribute
in interface AttributedCharacterIterator
attribute
- the key of the attribute whose value is requested.private AttributedString getString()
private char internalSetIndex(int position)
private void updateRunInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |