Top Fields Constructors Methods
com.sun.javafx.text

pack-priv Class CharArrayIterator

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

Field Summary

Modifier and TypeField and Description
private int
private char[]
private int

Constructor Summary

AccessConstructor and Description
public
CharArrayIterator(char[] chars)

public
CharArrayIterator(char[] chars, int begin)

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

A copy of this
clone
()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Create a copy of this iterator

public char

Returns:

the character at the current position or DONE if the current position is off the end of the text.
current
()

Implements java.text.CharacterIterator.current.

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

public char

Returns:

the first character in the text, or DONE if the text is empty
first
()

Implements java.text.CharacterIterator.first.

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

public int

Returns:

the index at which the text begins.
getBeginIndex
()

Implements java.text.CharacterIterator.getBeginIndex.

Returns the start index of the text.

public int

Returns:

the index after the last character in the text
getEndIndex
()

Implements java.text.CharacterIterator.getEndIndex.

Returns the end index of the text.

public int

Returns:

the current index.
getIndex
()

Implements java.text.CharacterIterator.getIndex.

Returns the current index.

public char

Returns:

the last character in the text, or DONE if the text is empty
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

Returns:

the character at the new position or DONE if the new position is off the end of the text range.
next
()

Implements java.text.CharacterIterator.next.

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

public char

Returns:

the character at the new position or DONE if the current position is equal to getBeginIndex().
previous
()

Implements java.text.CharacterIterator.previous.

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

pack-priv void
reset(char[] chars)

pack-priv void
reset(char[] chars, int begin)

public char

Returns:

the character at the specified position or DONE if the specified position is equal to getEndIndex()
setIndex
(int
the position within the text. Valid values range from getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown if an invalid value is supplied.
position
)

Implements java.text.CharacterIterator.setIndex.

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

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beginback to summary
private int begin
charsback to summary
private char[] chars
posback to summary
private int pos

Constructor Detail

CharArrayIteratorback to summary
public CharArrayIterator(char[] chars)
CharArrayIteratorback to summary
public CharArrayIterator(char[] chars, int begin)

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Create a copy of this iterator

Returns:Object

A copy of this

Annotations
@Override
currentback to summary
public char current()

Implements java.text.CharacterIterator.current.

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

Returns:char

the character at the current position or DONE if the current position is off the end of the text.

Annotations
@Override
See Also
getIndex
firstback to summary
public char first()

Implements java.text.CharacterIterator.first.

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

Returns:char

the first character in the text, or DONE if the text is empty

Annotations
@Override
See Also
getBeginIndex
getBeginIndexback to summary
public int getBeginIndex()

Implements java.text.CharacterIterator.getBeginIndex.

Returns the start index of the text.

Returns:int

the index at which the text begins.

Annotations
@Override
getEndIndexback to summary
public int getEndIndex()

Implements 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.

Returns:int

the index after the last character in the text

Annotations
@Override
getIndexback to summary
public int getIndex()

Implements java.text.CharacterIterator.getIndex.

Returns the current index.

Returns:int

the current index.

Annotations
@Override
lastback to summary
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.

Returns:char

the last character in the text, or DONE if the text is empty

Annotations
@Override
See Also
getEndIndex
nextback to summary
public char next()

Implements 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.

Returns:char

the character at the new position or DONE if the new position is off the end of the text range.

Annotations
@Override
previousback to summary
public char previous()

Implements 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.

Returns:char

the character at the new position or DONE if the current position is equal to getBeginIndex().

Annotations
@Override
resetback to summary
pack-priv void reset(char[] chars)
resetback to summary
pack-priv void reset(char[] chars, int begin)
setIndexback to summary
public char setIndex(int position)

Implements java.text.CharacterIterator.setIndex.

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

Parameters
position:int

the position within the text. Valid values range from getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown if an invalid value is supplied.

Returns:char

the character at the specified position or DONE if the specified position is equal to getEndIndex()

Annotations
@Override