Class AnyTransliterator.ScriptRunIterator

java.lang.Object
com.ibm.icu.text.AnyTransliterator.ScriptRunIterator
Enclosing class:
AnyTransliterator

private static class AnyTransliterator.ScriptRunIterator extends Object
Returns a series of ranges corresponding to scripts. They will be of the form: ccccSScSSccccTTcTcccc - c = common, S = first script, T = second | | - first run (start, limit) | | - second run (start, limit) That is, the runs will overlap. The reason for this is so that a transliterator can consider common characters both before and after the scripts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The end of the run, exclusive, valid after next() returns.
    int
    The code of the current run, valid after next() returns.
    int
    The start of the run, inclusive, valid after next() returns.
    private Replaceable
     
    private int
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScriptRunIterator(Replaceable text, int start, int limit)
    Constructs a run iterator over the given text from start (inclusive) to limit (exclusive).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    adjustLimit(int delta)
    Adjusts internal indices for a change in the limit index of the given delta.
    boolean
    Returns true if there are any more runs.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • text

      private Replaceable text
    • textStart

      private int textStart
    • textLimit

      private int textLimit
    • scriptCode

      public int scriptCode
      The code of the current run, valid after next() returns. May be UScript.INVALID_CODE if and only if the entire text is COMMON/INHERITED.
    • start

      public int start
      The start of the run, inclusive, valid after next() returns.
    • limit

      public int limit
      The end of the run, exclusive, valid after next() returns.
  • Constructor Details

    • ScriptRunIterator

      public ScriptRunIterator(Replaceable text, int start, int limit)
      Constructs a run iterator over the given text from start (inclusive) to limit (exclusive).
  • Method Details

    • next

      public boolean next()
      Returns true if there are any more runs. true is always returned at least once. Upon return, the caller should examine scriptCode, start, and limit.
    • adjustLimit

      public void adjustLimit(int delta)
      Adjusts internal indices for a change in the limit index of the given delta. A positive delta means the limit has increased.