|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.text.Normalizer2
com.ibm.icu.text.FilteredNormalizer2
public class FilteredNormalizer2
Normalization filtered by a UnicodeSet. Normalizes portions of the text contained in the filter set and leaves portions not contained in the filter set unchanged. Filtering is done via UnicodeSet.span(..., UnicodeSet.SpanCondition.SIMPLE). Not-in-the-filter text is treated as "is normalized" and "quick check yes". This class implements all of (and only) the Normalizer2 API. An instance of this class is unmodifiable/immutable.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.ibm.icu.text.Normalizer2 |
---|
Normalizer2.Mode |
Constructor Summary | |
---|---|
FilteredNormalizer2(Normalizer2 n2,
UnicodeSet filterSet)
Constructs a filtered normalizer wrapping any Normalizer2 instance and a filter set. |
Method Summary | |
---|---|
java.lang.StringBuilder |
append(java.lang.StringBuilder first,
java.lang.CharSequence second)
Appends the second string to the first string (merging them at the boundary) and returns the first string. |
boolean |
hasBoundaryAfter(int c)
Tests if the character always has a normalization boundary after it, regardless of context. |
boolean |
hasBoundaryBefore(int c)
Tests if the character always has a normalization boundary before it, regardless of context. |
boolean |
isInert(int c)
Tests if the character is normalization-inert. |
boolean |
isNormalized(java.lang.CharSequence s)
Tests if the string is normalized. |
java.lang.Appendable |
normalize(java.lang.CharSequence src,
java.lang.Appendable dest)
Writes the normalized form of the source string to the destination Appendable and returns the destination Appendable. |
java.lang.StringBuilder |
normalize(java.lang.CharSequence src,
java.lang.StringBuilder dest)
Writes the normalized form of the source string to the destination string (replacing its contents) and returns the destination string. |
java.lang.StringBuilder |
normalizeSecondAndAppend(java.lang.StringBuilder first,
java.lang.CharSequence second)
Appends the normalized form of the second string to the first string (merging them at the boundary) and returns the first string. |
Normalizer.QuickCheckResult |
quickCheck(java.lang.CharSequence s)
Tests if the string is normalized. |
int |
spanQuickCheckYes(java.lang.CharSequence s)
Returns the end of the normalized substring of the input string. |
Methods inherited from class com.ibm.icu.text.Normalizer2 |
---|
getInstance, normalize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilteredNormalizer2(Normalizer2 n2, UnicodeSet filterSet)
n2
- wrapped Normalizer2 instancefilterSet
- UnicodeSet which determines the characters to be normalizedMethod Detail |
---|
public java.lang.StringBuilder normalize(java.lang.CharSequence src, java.lang.StringBuilder dest)
normalize
in class Normalizer2
src
- source stringdest
- destination string; its contents is replaced with normalized src
public java.lang.Appendable normalize(java.lang.CharSequence src, java.lang.Appendable dest)
normalize
in class Normalizer2
src
- source stringdest
- destination Appendable; gets normalized src appended
public java.lang.StringBuilder normalizeSecondAndAppend(java.lang.StringBuilder first, java.lang.CharSequence second)
normalizeSecondAndAppend
in class Normalizer2
first
- string, should be normalizedsecond
- string, will be normalized
public java.lang.StringBuilder append(java.lang.StringBuilder first, java.lang.CharSequence second)
append
in class Normalizer2
first
- string, should be normalizedsecond
- string, should be normalized
public boolean isNormalized(java.lang.CharSequence s)
isNormalized
in class Normalizer2
s
- input string
public Normalizer.QuickCheckResult quickCheck(java.lang.CharSequence s)
quickCheck
in class Normalizer2
s
- input string
public int spanQuickCheckYes(java.lang.CharSequence s)
end=spanQuickCheckYes(s);
the substring s.subSequence(0, end)
will pass the quick check with a "yes" result.
The returned end index is usually one or more characters before the "no" or "maybe" character: The end index is at a normalization boundary. (See the class documentation for more about normalization boundaries.)
When the goal is a normalized string and most input strings are expected to be normalized already, then call this method, and if it returns a prefix shorter than the input string, copy that prefix and use normalizeSecondAndAppend() for the remainder.
spanQuickCheckYes
in class Normalizer2
s
- input string
public boolean hasBoundaryBefore(int c)
hasBoundaryBefore
in class Normalizer2
c
- character to test
public boolean hasBoundaryAfter(int c)
Note that this operation may be significantly slower than hasBoundaryBefore().
hasBoundaryAfter
in class Normalizer2
c
- character to test
public boolean isInert(int c)
Note that this operation may be significantly slower than hasBoundaryBefore().
isInert
in class Normalizer2
c
- character to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |