Package com.ibm.icu.impl
Class Normalizer2Impl.ReorderingBuffer
java.lang.Object
com.ibm.icu.impl.Normalizer2Impl.ReorderingBuffer
- All Implemented Interfaces:
Appendable
- Enclosing class:
- Normalizer2Impl
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Appendable
private final boolean
private int
private int
private final Normalizer2Impl
private int
private int
private final StringBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend
(char c) void
append
(int c, int cc) append
(CharSequence s, int start, int limit) void
append
(CharSequence s, int start, int limit, boolean isNFD, int leadCC, int trailCC) void
appendZeroCC
(int c) boolean
equals
(CharSequence s, int start, int limit) void
flush()
Flushes from the intermediate StringBuilder to the Appendable, if they are different objects.flushAndAppendZeroCC
(CharSequence s, int start, int limit) Flushes from the intermediate StringBuilder to the Appendable, if they are different objects.int
private void
insert
(int c, int cc) boolean
isEmpty()
int
length()
private int
void
remove()
void
removeSuffix
(int suffixLength) private void
private void
-
Field Details
-
impl
-
app
-
str
-
appIsStringBuilder
private final boolean appIsStringBuilder -
reorderStart
private int reorderStart -
lastCC
private int lastCC -
codePointStart
private int codePointStart -
codePointLimit
private int codePointLimit
-
-
Constructor Details
-
ReorderingBuffer
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
length
public int length() -
getLastCC
public int getLastCC() -
getStringBuilder
-
equals
-
append
public void append(int c, int cc) -
append
-
append
- Specified by:
append
in interfaceAppendable
-
appendZeroCC
public void appendZeroCC(int c) -
append
- Specified by:
append
in interfaceAppendable
-
append
- Specified by:
append
in interfaceAppendable
-
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
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()
-