Class Normalizer2Impl.ReorderingBuffer

  • All Implemented Interfaces:
    java.lang.Appendable
    Enclosing class:
    Normalizer2Impl

    public static final class Normalizer2Impl.ReorderingBuffer
    extends java.lang.Object
    implements java.lang.Appendable
    Writable buffer that takes care of canonical ordering. Its Appendable methods behave like the C++ implementation's appendZeroCC() methods.

    If dest is a StringBuilder, then the buffer writes directly to it. Otherwise, the buffer maintains a StringBuilder for intermediate text segments until no further changes are necessary and whole segments are appended. append() methods that take combining-class values always write to the StringBuilder. Other append() methods flush and append to the Appendable.

    • Field Detail

      • app

        private final java.lang.Appendable app
      • str

        private final java.lang.StringBuilder str
      • appIsStringBuilder

        private final boolean appIsStringBuilder
      • reorderStart

        private int reorderStart
      • lastCC

        private int lastCC
      • codePointStart

        private int codePointStart
      • codePointLimit

        private int codePointLimit
    • Constructor Detail

      • ReorderingBuffer

        public ReorderingBuffer​(Normalizer2Impl ni,
                                java.lang.Appendable dest,
                                int destCapacity)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • length

        public int length()
      • getLastCC

        public int getLastCC()
      • getStringBuilder

        public java.lang.StringBuilder getStringBuilder()
      • equals

        public boolean equals​(java.lang.CharSequence s,
                              int start,
                              int limit)
      • append

        public void append​(int c,
                           int cc)
      • append

        public void append​(java.lang.CharSequence s,
                           int start,
                           int limit,
                           boolean isNFD,
                           int leadCC,
                           int trailCC)
      • appendZeroCC

        public void appendZeroCC​(int c)
      • append

        public Normalizer2Impl.ReorderingBuffer append​(java.lang.CharSequence s,
                                                       int start,
                                                       int limit)
        Specified by:
        append in interface java.lang.Appendable
      • flush

        public void flush()
        Flushes from the intermediate StringBuilder to the Appendable, if they are different objects. Used after recomposition. Must be called at the end when writing to a non-StringBuilder Appendable.
      • flushAndAppendZeroCC

        public Normalizer2Impl.ReorderingBuffer flushAndAppendZeroCC​(java.lang.CharSequence s,
                                                                     int start,
                                                                     int limit)
        Flushes from the intermediate StringBuilder to the Appendable, if they are different objects. Then appends the new text to the Appendable or StringBuilder. Normally used after quick check loops find a non-empty sequence.
      • remove

        public void remove()
      • removeSuffix

        public void removeSuffix​(int suffixLength)
      • insert

        private void insert​(int c,
                            int cc)
      • setIterator

        private void setIterator()
      • skipPrevious

        private void skipPrevious()
      • previousCC

        private int previousCC()