Class java.text.StringCharacterIterator
java.lang.Object
|
+----java.text.StringCharacterIterator
- public final class StringCharacterIterator
- extends Object
- implements CharacterIterator, Serializable
StringCharacterIterator
implements the
CharacterIterater
protocol for a String
.
The StringCharacterIterator
class iterates over the
entire String
.
- See Also:
- CharacterIterator
Method Summary
|
Object
|
clone()
Creates a copy of this iterator.
|
char
|
current()
Implements CharacterIterator.current() for String.
|
boolean
|
equals(Object obj)
Compares the equality of two StringCharacterIterator objects.
|
char
|
first()
Implements CharacterIterator.first() for String.
|
int
|
getBeginIndex()
Implements CharacterIterator.getBeginIndex() for String.
|
int
|
getEndIndex()
Implements CharacterIterator.getEndIndex() for String.
|
int
|
getIndex()
Implements CharacterIterator.getIndex() for String.
|
int
|
hashCode()
Computes a hashcode for this iterator.
|
char
|
last()
Implements CharacterIterator.last() for String.
|
char
|
next()
Implements CharacterIterator.next() for String.
|
char
|
previous()
Implements CharacterIterator.previous() for String.
|
char
|
setIndex(int p)
Implements CharacterIterator.setIndex() for String.
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringCharacterIterator
public StringCharacterIterator(String text)
- Constructs an iterator with an initial index of 0.
StringCharacterIterator
public StringCharacterIterator(String text,
int pos)
- Constructs an iterator with the specified initial index.
- Parameters:
text
- The String to be iterated over
pos
- Initial iterator position
StringCharacterIterator
public StringCharacterIterator(String text,
int begin,
int end,
int pos)
- Constructs an iterator over the given range of the given string, with the
index set at the specified position.
- Parameters:
text
- The String to be iterated over
begin
- Index of the first character
end
- Index of the character following the last character
pos
- Initial iterator position
first
public char first()
- Implements CharacterIterator.first() for String.
- Implements:
- first in interface CharacterIterator
- See Also:
- first
last
public char last()
- Implements CharacterIterator.last() for String.
- Implements:
- last in interface CharacterIterator
- See Also:
- last
setIndex
public char setIndex(int p)
- Implements CharacterIterator.setIndex() for String.
- Implements:
- setIndex in interface CharacterIterator
- See Also:
- setIndex
current
public char current()
- Implements CharacterIterator.current() for String.
- Implements:
- current in interface CharacterIterator
- See Also:
- current
next
public char next()
- Implements CharacterIterator.next() for String.
- Implements:
- next in interface CharacterIterator
- See Also:
- next
previous
public char previous()
- Implements CharacterIterator.previous() for String.
- Implements:
- previous in interface CharacterIterator
- See Also:
- previous
getBeginIndex
public int getBeginIndex()
- Implements CharacterIterator.getBeginIndex() for String.
- Implements:
- getBeginIndex in interface CharacterIterator
- See Also:
- getBeginIndex
getEndIndex
public int getEndIndex()
- Implements CharacterIterator.getEndIndex() for String.
- Implements:
- getEndIndex in interface CharacterIterator
- See Also:
- getEndIndex
getIndex
public int getIndex()
- Implements CharacterIterator.getIndex() for String.
- Implements:
- getIndex in interface CharacterIterator
- See Also:
- getIndex
equals
public boolean equals(Object obj)
- Compares the equality of two StringCharacterIterator objects.
- Parameters:
obj
- the StringCharacterIterator object to be compared with.
- Returns:
- true if the given obj is the same as this
StringCharacterIterator object; false otherwise.
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Computes a hashcode for this iterator.
- Returns:
- A hash code
- Overrides:
- hashCode in class Object
clone
public Object clone()
- Creates a copy of this iterator.
- Implements:
- clone in interface CharacterIterator
- Returns:
- A copy of this
- Overrides:
- clone in class Object
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.