Interface ICodepointIterator

All Superinterfaces:
Iterator<Codepoint>
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 Details

    • hasNext

      default boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Codepoint>
      Returns:
      true if there are codepoints remaining
    • 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
    • next

      Specified by:
      next in interface Iterator<Codepoint>
      Returns:
      the next codepoint
    • peek

      Returns:
      Peek the next codepoint
    • 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:
      true if the char at the specified index is a high surrogate
    • isLow

      boolean isLow(@Nonnegative int nIndex)
      Parameters:
      nIndex - index
      Returns:
      true if 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)