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