Class DelegatingCodepointIterator
- java.lang.Object
-
- com.helger.commons.text.codepoint.DelegatingCodepointIterator
-
- All Implemented Interfaces:
ICodepointIterator,Iterator<Codepoint>
- Direct Known Subclasses:
CodepointIteratorRestricted
public class DelegatingCodepointIterator extends Object implements ICodepointIterator
Base implementation of a CodepointIterator that filters the output of anotherICodepointIterator- Author:
- Apache Abdera
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDelegatingCodepointIterator(AbstractCodepointIterator aInternal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected charget()protected charget(int index)AbstractCodepointIteratorgetInternalIterator()booleanhasNext()booleanisHigh(int index)booleanisLow(int index)intlastPosition()intlimit()Codepointnext()char[]nextChars()Codepointpeek()Codepointpeek(int index)char[]peekChars()intposition()voidposition(int position)Set the iterator positionintremaining()voidremove()CodepointIteratorRestrictedrestrict(IntPredicate aFilter)CodepointIteratorRestrictedrestrict(IntPredicate aFilter, boolean bScanning)CodepointIteratorRestrictedrestrict(IntPredicate aFilter, boolean bScanning, boolean bInvert)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
DelegatingCodepointIterator
protected DelegatingCodepointIterator(@Nonnull AbstractCodepointIterator aInternal)
-
-
Method Detail
-
getInternalIterator
@Nonnull public AbstractCodepointIterator 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
@Nullable public Codepoint next()
- Specified by:
nextin interfaceICodepointIterator- Specified by:
nextin interfaceIterator<Codepoint>- Returns:
- the next codepoint
-
nextChars
@Nullable public char[] 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
@Nullable public Codepoint peek()
- Specified by:
peekin interfaceICodepointIterator- Returns:
- Peek the next codepoint
-
peek
@Nullable public Codepoint peek(int index)
- Specified by:
peekin interfaceICodepointIterator- Parameters:
index- index- Returns:
- Peek the specified codepoint
-
peekChars
@Nullable public char[] 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
-
restrict
@Nonnull public CodepointIteratorRestricted restrict(@Nonnull IntPredicate aFilter)
- 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
-
-