APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.internal.icu.impl

public final Class NormalizerImpl

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, jdk.internal.icu.lang.UCharacter, jdk.internal.icu.text.Normalizer2, .UTF16, jdk.internal.icu.util.CodePointTrie, .VersionInfo

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
private static class
private static class
public static class
NormalizerImpl.ReorderingBuffer

Writable buffer that takes care of canonical ordering.

public static class

Field Summary

Modifier and TypeField and Description
private int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private static final int
private VersionInfo
public static final int
public static final int
public static final int
public static final int
public static final int
private String
public static final int
public static final int
private static final NormalizerImpl.IsAcceptable
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
IX_MIN_MAYBE_NO

Two-way mappings; each starts with a character that combines backward.

public static final int
IX_MIN_MAYBE_NO_COMBINES_FWD

Two-way mappings & compositions.

public static final int
public static final int
IX_MIN_NO_NO

Mappings are comp-normalized.

public static final int
IX_MIN_NO_NO_COMP_BOUNDARY_BEFORE

Mappings are not comp-normalized but have a comp boundary before.

public static final int
IX_MIN_NO_NO_COMP_NO_MAYBE_CC

Mappings do not have a comp boundary before.

public static final int
IX_MIN_NO_NO_EMPTY

Mappings to the empty string.

public static final int
IX_MIN_YES_NO

Mappings & compositions in [minYesNo..minYesNoMappingsOnly[.

public static final int
IX_MIN_YES_NO_MAPPINGS_ONLY

Mappings only in [minYesNoMappingsOnly..minNoNo[.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private CodePointTrie.Fast16
public static final int
private byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
private int
combine(int list, int trail)

Finds the recomposition result for a forward-combining "lead" character, specified with a pointer to its compositions list, and a backward-combining "trail" character.

public boolean
compose(CharSequence s, int src, int limit, boolean onlyContiguous, boolean doCompose, NormalizerImpl.ReorderingBuffer buffer)

public void
composeAndAppend(CharSequence s, boolean doCompose, boolean onlyContiguous, NormalizerImpl.ReorderingBuffer buffer)

public int

Returns:

bits 31..1: spanQuickCheckYes (==s.length() if "yes") and bit 0: set if "maybe"; otherwise, if the span length<s.length() then the quick check result is "no"
composeQuickCheck
(CharSequence s, int src, int limit, boolean onlyContiguous, boolean doSpan)

Very similar to compose(): Make the same changes in both places if relevant.

public void
decompose(CharSequence s, int src, int limit, StringBuilder dest, int destLengthEstimate)

Decomposes s[src, limit[ and writes the result to dest.

public int
decompose(CharSequence s, int src, int limit, NormalizerImpl.ReorderingBuffer buffer)

private void
decompose(int c, int norm16, NormalizerImpl.ReorderingBuffer buffer)

public void
private int
decomposeShort(CharSequence s, int src, int limit, boolean stopAtCompBoundary, boolean onlyContiguous, NormalizerImpl.ReorderingBuffer buffer)

private int
findNextCompBoundary(CharSequence s, int p, int limit, boolean onlyContiguous)

private int
findNextFCDBoundary(CharSequence s, int p, int limit)

private int
findPreviousCompBoundary(CharSequence s, int p, boolean onlyContiguous)

public int
getCC(int norm16)

private int
getCCFromNoNo(int norm16)

public static int
public static int
public int
private int
getCompositionsListForComposite(int norm16)

Returns: index into maybeYesCompositions

private int
getCompositionsListForDecompYes(int norm16)

Returns: index into extraData, or -1

private int
getData(int norm16)

private int
getDataForMaybe(int norm16)

private int
getDataForYesOrNo(int norm16)

public static int
getDecompose(int[] chars, String[] decomps)

Get the canonical decomposition sherman for ComposedCharIter

public String

Returns:

c's decomposition, if it has one; returns null if it does not have a decomposition
getDecomposition
(int
code point
c
)

Gets the decomposition for one code point.

public int

Returns:

The lccc(c) in bits 15..8 and tccc(c) in bits 7..0.
getFCD16
(int
A Unicode code point.
c
)

Returns the FCD data for code point c.

private int
public int
getFCD16FromNormData(int c)

Gets the FCD value from the regular normalization data.

private static int
public int
getNorm16(int c)

private static int
private int
getPreviousTrailCC(CharSequence s, int start, int p)

public int
getRawNorm16(int c)

pack-priv int
private int
public boolean
hasCompBoundaryAfter(int c, boolean onlyContiguous)

private boolean
hasCompBoundaryAfter(CharSequence s, int start, int p, boolean onlyContiguous)

public boolean
private boolean
hasCompBoundaryBefore(int c, int norm16)

Does c have a composition boundary before it?

private boolean
hasCompBoundaryBefore(CharSequence s, int src, int limit)

public boolean
public boolean
private static int

Returns:

the trailing combining class
insertOrdered
(char[] source, int start, int current, int p, char c1, char c2, int cc)

simpler, single-character version of mergeOrdered() - bubble-insert one single code point into the preceding string which is already canonically ordered (c, c2) may or may not yet have been inserted at src[current]..src[p] it must be p=current+lengthof(c, c2) i.e. p=current+(c2==0 ?

public boolean
isAlgorithmicNoNo(int norm16)

public boolean
isCompNo(int norm16)

private boolean
isCompYesAndZeroCC(int norm16)

public boolean
private boolean
isDecompNoAlgorithmic(int norm16)

Since formatVersion 5: same as isAlgorithmicNoNo()

public boolean
isDecompYes(int norm16)

private boolean
private boolean
isHangulLV(int norm16)

private boolean
isHangulLVT(int norm16)

private static boolean
isInert(int norm16)

private static boolean
isJamoVT(int norm16)

private boolean
isMaybe(int norm16)

private boolean
private boolean
isMostDecompYesAndZeroCC(int norm16)

A little faster and simpler than isDecompYesAndZeroCC() but does not include the MaybeYes which combine-forward and have ccc=0.

private boolean
isTrailCC01ForCompBoundaryAfter(int norm16)

For FCC: Given norm16 HAS_COMP_BOUNDARY_AFTER, does it have tccc<=1?

public NormalizerImpl
public NormalizerImpl
load(String name)

public int
makeFCD(CharSequence s, int src, int limit, NormalizerImpl.ReorderingBuffer buffer)

private int
mapAlgorithmic(int c, int norm16)

private static int

Returns:

the trailing combining class
mergeOrdered
(char[] source, int start, int current, char[] data, int next, int limit)

merge two UTF-16 string parts together to canonically order (order by combining classes) their concatenation the two strings may already be adjacent, so that the merging is done in-place if the two strings are not adjacent, then the buffer holding the first one must be large enough the second string may or may not be ordered in itself before: [start]..[current] is already ordered, and [next]..[limit] may be ordered in itself, but is not in relation to [start..current[ after: [start..current+(limit-next)[ is ordered the algorithm is a simple bubble-sort that takes the characters from src[next++] and inserts them in correct combining class order into the preceding part of the string since this function is called much less often than the single-code point insertOrdered(), it just uses that for easier maintenance

private static boolean
private boolean
norm16HasCompBoundaryAfter(int norm16, boolean onlyContiguous)

private boolean
public boolean
public boolean
private void
recompose(NormalizerImpl.ReorderingBuffer buffer, int recomposeStartIndex, boolean onlyContiguous)

public boolean
singleLeadMightHaveNonZeroFCD16(int lead)

Returns true if the single-or-lead code unit c might have non-zero FCD data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait