Class DelegatingCodepointIterator
java.lang.Object
com.helger.commons.text.codepoint.DelegatingCodepointIterator
- All Implemented Interfaces:
ICodepointIterator,Iterator<Codepoint>
- Direct Known Subclasses:
CodepointIteratorRestricted
Base implementation of a CodepointIterator that filters the output of another
ICodepointIterator- Author:
- Apache Abdera
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected charget()protected charget(int index) booleanhasNext()booleanisHigh(int index) booleanisLow(int index) intintlimit()next()char[]peek()peek(int index) char[]intposition()voidposition(int position) Set the iterator positionintvoidremove()restrict(IntPredicate aFilter) restrict(IntPredicate aFilter, boolean bScanning) restrict(IntPredicate aFilter, boolean bScanning, boolean bInvert) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
DelegatingCodepointIterator
-
-
Method Details
-
getInternalIterator
-
get
protected char get() -
get
protected char get(int index) -
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceICodepointIterator- Specified by:
hasNextin interfaceIterator<Codepoint>- Returns:
trueif there are codepoints remaining
-
lastPosition
public int lastPosition()- Specified by:
lastPositionin interfaceICodepointIterator- Returns:
- the final index position
-
isHigh
public boolean isHigh(int index) - Specified by:
isHighin interfaceICodepointIterator- Parameters:
index- index- Returns:
trueif the char at the specified index is a high surrogate
-
isLow
public boolean isLow(int index) - Specified by:
isLowin interfaceICodepointIterator- Parameters:
index- index- Returns:
trueif the char at the specified index is a low surrogate
-
limit
public int limit()- Specified by:
limitin interfaceICodepointIterator- Returns:
- the iterator limit
-
next
- Specified by:
nextin interfaceICodepointIterator- Specified by:
nextin interfaceIterator<Codepoint>- Returns:
- the next codepoint
-
nextChars
- Specified by:
nextCharsin interfaceICodepointIterator- Returns:
- the next chars. If the codepoint is not supplemental, the char array will have a single member. If the codepoint is supplemental, the char array will have two members, representing the high and low surrogate chars
-
peek
- Specified by:
peekin interfaceICodepointIterator- Returns:
- Peek the next codepoint
-
peek
- Specified by:
peekin interfaceICodepointIterator- Parameters:
index- index- Returns:
- Peek the specified codepoint
-
peekChars
- Specified by:
peekCharsin interfaceICodepointIterator- Returns:
- Peek the next chars in the iterator. If the codepoint is not supplemental, the char array will have a single member. If the codepoint is supplemental, the char array will have two members, representing the high and low surrogate chars
-
position
public int position()- Specified by:
positionin interfaceICodepointIterator- Returns:
- the iterator position
-
remaining
public int remaining()- Specified by:
remainingin interfaceICodepointIterator- Returns:
- the remaining iterator size
-
position
public void position(int position) Description copied from interface:ICodepointIteratorSet the iterator position- Specified by:
positionin interfaceICodepointIterator- Parameters:
position- new position
-
remove
public void remove() -
restrict
- Specified by:
restrictin interfaceICodepointIterator
-
restrict
@Nonnull public CodepointIteratorRestricted restrict(@Nonnull IntPredicate aFilter, boolean bScanning) - Specified by:
restrictin interfaceICodepointIterator
-
restrict
@Nonnull public CodepointIteratorRestricted restrict(@Nonnull IntPredicate aFilter, boolean bScanning, boolean bInvert) - Specified by:
restrictin interfaceICodepointIterator
-