Package com.ibm.icu.text
Class BreakTransliterator.ReplaceableCharacterIterator
- java.lang.Object
-
- com.ibm.icu.text.BreakTransliterator.ReplaceableCharacterIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.text.CharacterIterator
- Enclosing class:
- BreakTransliterator
static final class BreakTransliterator.ReplaceableCharacterIterator extends java.lang.Object implements java.text.CharacterIterator
-
-
Field Summary
Fields Modifier and Type Field Description private int
begin
private int
end
private int
pos
private Replaceable
text
-
Constructor Summary
Constructors Constructor Description ReplaceableCharacterIterator(Replaceable 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Creates a copy of this iterator.char
current()
Implements CharacterIterator.current() for String.boolean
equals(java.lang.Object obj)
Compares the equality of two ReplaceableCharacterIterator 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.void
setText(Replaceable text)
Reset this iterator to point to a new string.
-
-
-
Field Detail
-
text
private Replaceable text
-
begin
private int begin
-
end
private int end
-
pos
private int pos
-
-
Constructor Detail
-
ReplaceableCharacterIterator
public ReplaceableCharacterIterator(Replaceable 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 overbegin
- Index of the first characterend
- Index of the character following the last characterpos
- Initial iterator position
-
-
Method Detail
-
setText
public void setText(Replaceable text)
Reset this iterator to point to a new string. This package-visible method is used by other java.text classes that want to avoid allocating new ReplaceableCharacterIterator objects every time their setText method is called.- Parameters:
text
- The String to be iterated over
-
first
public char first()
Implements CharacterIterator.first() for String.- Specified by:
first
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.first()
-
last
public char last()
Implements CharacterIterator.last() for String.- Specified by:
last
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.last()
-
setIndex
public char setIndex(int p)
Implements CharacterIterator.setIndex() for String.- Specified by:
setIndex
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.setIndex(int)
-
current
public char current()
Implements CharacterIterator.current() for String.- Specified by:
current
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.current()
-
next
public char next()
Implements CharacterIterator.next() for String.- Specified by:
next
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.next()
-
previous
public char previous()
Implements CharacterIterator.previous() for String.- Specified by:
previous
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.previous()
-
getBeginIndex
public int getBeginIndex()
Implements CharacterIterator.getBeginIndex() for String.- Specified by:
getBeginIndex
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.getBeginIndex()
-
getEndIndex
public int getEndIndex()
Implements CharacterIterator.getEndIndex() for String.- Specified by:
getEndIndex
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.getEndIndex()
-
getIndex
public int getIndex()
Implements CharacterIterator.getIndex() for String.- Specified by:
getIndex
in interfacejava.text.CharacterIterator
- See Also:
CharacterIterator.getIndex()
-
equals
public boolean equals(java.lang.Object obj)
Compares the equality of two ReplaceableCharacterIterator objects.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the ReplaceableCharacterIterator object to be compared with.- Returns:
- true if the given obj is the same as this ReplaceableCharacterIterator object; false otherwise.
-
hashCode
public int hashCode()
Computes a hashcode for this iterator.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code
-
clone
public java.lang.Object clone()
Creates a copy of this iterator.- Specified by:
clone
in interfacejava.text.CharacterIterator
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A copy of this
-
-