Interface ICodepointIterator
- All Known Implementing Classes:
AbstractCodepointIterator,CodepointIteratorByteArray,CodepointIteratorByteBuffer,CodepointIteratorCharArray,CodepointIteratorCharBuffer,CodepointIteratorCharSequence,CodepointIteratorInputStream,CodepointIteratorReadableByteChannel,CodepointIteratorReader,CodepointIteratorRestricted,DelegatingCodepointIterator
BAse interface for codepoint iterators
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasNext()booleanisHigh(int nIndex) booleanisLow(int nIndex) intintlimit()next()char[]peek()peek(int nIndex) char[]intposition()voidposition(int nPos) Set the iterator positionintdefault CodepointIteratorRestrictedrestrict(IntPredicate aFilter) default CodepointIteratorRestrictedrestrict(IntPredicate aFilter, boolean bScanning) restrict(IntPredicate aFilter, boolean bScanning, boolean bInvert) Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Method Details
-
hasNext
default boolean hasNext() -
lastPosition
- Returns:
- the final index position
-
nextChars
- 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
-
peekChars
- 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
-
next
-
peek
- Returns:
- Peek the next codepoint
-
peek
- Parameters:
nIndex- index- Returns:
- Peek the specified codepoint
-
position
Set the iterator position- Parameters:
nPos- new position
-
position
- Returns:
- the iterator position
-
limit
- Returns:
- the iterator limit
-
remaining
- Returns:
- the remaining iterator size
-
isHigh
- Parameters:
nIndex- index- Returns:
trueif the char at the specified index is a high surrogate
-
isLow
- Parameters:
nIndex- index- Returns:
trueif the char at the specified index is a low surrogate
-
restrict
-
restrict
@Nonnull default CodepointIteratorRestricted restrict(@Nonnull IntPredicate aFilter, boolean bScanning) -
restrict
@Nonnull CodepointIteratorRestricted restrict(@Nonnull IntPredicate aFilter, boolean bScanning, boolean bInvert)
-