Package com.ibm.icu.impl
Class Normalizer2Impl.ReorderingBuffer
- java.lang.Object
-
- com.ibm.icu.impl.Normalizer2Impl.ReorderingBuffer
-
- All Implemented Interfaces:
Appendable
- Enclosing class:
- Normalizer2Impl
public static final class Normalizer2Impl.ReorderingBuffer extends Object implements 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.
-
-
Constructor Summary
Constructors Constructor Description ReorderingBuffer(Normalizer2Impl ni, Appendable dest, int destCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Normalizer2Impl.ReorderingBufferappend(char c)Appends the specified character.voidappend(int c, int cc)Normalizer2Impl.ReorderingBufferappend(CharSequence s)Appends the character sequencecsq.Normalizer2Impl.ReorderingBufferappend(CharSequence s, int start, int limit)Appends a subsequence ofcsq.voidappend(CharSequence s, int start, int limit, int leadCC, int trailCC)voidappendZeroCC(int c)booleanequals(CharSequence s, int start, int limit)voidflush()Flushes from the intermediate StringBuilder to the Appendable, if they are different objects.Normalizer2Impl.ReorderingBufferflushAndAppendZeroCC(CharSequence s, int start, int limit)Flushes from the intermediate StringBuilder to the Appendable, if they are different objects.intgetLastCC()StringBuildergetStringBuilder()booleanisEmpty()intlength()voidremove()voidremoveSuffix(int suffixLength)voidsetLastChar(char c)
-
-
-
Constructor Detail
-
ReorderingBuffer
public ReorderingBuffer(Normalizer2Impl ni, Appendable dest, int destCapacity)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
length
public int length()
-
getLastCC
public int getLastCC()
-
getStringBuilder
public StringBuilder getStringBuilder()
-
equals
public boolean equals(CharSequence s, int start, int limit)
-
setLastChar
public void setLastChar(char c)
-
append
public void append(int c, int cc)
-
append
public void append(CharSequence s, int start, int limit, int leadCC, int trailCC)
-
append
public Normalizer2Impl.ReorderingBuffer append(char c)
Description copied from interface:AppendableAppends the specified character.- Specified by:
appendin interfaceAppendable- Parameters:
c- the character to append.- Returns:
- this
Appendable.
-
appendZeroCC
public void appendZeroCC(int c)
-
append
public Normalizer2Impl.ReorderingBuffer append(CharSequence s)
Description copied from interface:AppendableAppends the character sequencecsq. Implementation classes may not append the whole sequence, for example if the target is a buffer with limited size.If
csqisnull, the characters "null" are appended.- Specified by:
appendin interfaceAppendable- Parameters:
s- the character sequence to append.- Returns:
- this
Appendable.
-
append
public Normalizer2Impl.ReorderingBuffer append(CharSequence s, int start, int limit)
Description copied from interface:AppendableAppends a subsequence ofcsq.If
csqis notnullthen calling this method is equivalent to callingappend(csq.subSequence(start, end)).If
csqisnull, the characters "null" are appended.- Specified by:
appendin interfaceAppendable- Parameters:
s- the character sequence to append.start- the first index of the subsequence ofcsqthat is appended.limit- the last index of the subsequence ofcsqthat is appended.- Returns:
- this
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(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)
-
-