Class Trie2.Trie2Iterator

java.lang.Object
com.ibm.icu.impl.Trie2.Trie2Iterator
All Implemented Interfaces:
Iterator<Trie2.Range>
Enclosing class:
Trie2

class Trie2.Trie2Iterator extends Object implements Iterator<Trie2.Range>
Implementation class for an iterator over a Trie2. Iteration over a Trie2 first returns all of the ranges that are indexed by code points, then returns the special alternate values for the lead surrogates
  • Field Details

    • mapper

      private Trie2.ValueMapper mapper
    • returnValue

      private Trie2.Range returnValue
    • nextStart

      private int nextStart
    • limitCP

      private int limitCP
    • doingCodePoints

      private boolean doingCodePoints
    • doLeadSurrogates

      private boolean doLeadSurrogates
  • Constructor Details

  • Method Details

    • next

      public Trie2.Range next()
      The main next() function for Trie2 iterators
      Specified by:
      next in interface Iterator<Trie2.Range>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Trie2.Range>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<Trie2.Range>
    • rangeEndLS

      private int rangeEndLS(char startingLS)
      Find the last lead surrogate in a contiguous range with the same Trie2 value as the input character. Use the alternate Lead Surrogate values from the Trie2, not the code-point values. Note: Trie2_16 and Trie2_32 override this implementation with optimized versions, meaning that the implementation here is only being used with Trie2Writable. The code here is logically correct with any type of Trie2, however.
      Parameters:
      c - The character to begin with.
      Returns:
      The last contiguous character with the same value.