Normalizer2 Class

Definition

Unicode normalization functionality for standard Unicode normalization or for using custom mapping tables.

[Android.Runtime.Register("android/icu/text/Normalizer2", ApiSince=24, DoNotGenerateAcw=true)]
public abstract class Normalizer2 : Java.Lang.Object
[<Android.Runtime.Register("android/icu/text/Normalizer2", ApiSince=24, DoNotGenerateAcw=true)>]
type Normalizer2 = class
    inherit Object
Inheritance
Normalizer2
Attributes

Remarks

Unicode normalization functionality for standard Unicode normalization or for using custom mapping tables. All instances of this class are unmodifiable/immutable. The Normalizer2 class is not intended for public subclassing.

The primary functions are to produce a normalized string and to detect whether a string is already normalized. The most commonly used normalization forms are those defined in https://www.unicode.org/reports/tr15/ However, this API supports additional normalization forms for specialized purposes. For example, NFKC_Casefold is provided via getInstance("nfkc_cf", COMPOSE) and can be used in implementations of UTS #46.

Not only are the standard compose and decompose modes supplied, but additional modes are provided as documented in the Mode enum.

Some of the functions in this class identify normalization boundaries. At a normalization boundary, the portions of the string before it and starting from it do not interact and can be handled independently.

The spanQuickCheckYes() stops at a normalization boundary. When the goal is a normalized string, then the text before the boundary can be copied, and the remainder can be processed with normalizeSecondAndAppend().

The hasBoundaryBefore(), hasBoundaryAfter() and isInert() functions test whether a character is guaranteed to be at a normalization boundary, regardless of context. This is used for moving from one normalization boundary to the next or preceding boundary, and for performing iterative normalization.

Iterative normalization is useful when only a small portion of a longer string needs to be processed. For example, in ICU, iterative normalization is used by the NormalizationTransliterator (to avoid replacing already-normalized text) and ucol_nextSortKeyPart() (to process only the substring for which sort key bytes are computed).

The set of normalization boundaries returned by these functions may not be complete: There may be more boundaries that could be returned. Different functions may return different boundaries.

Java documentation for android.icu.text.Normalizer2.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Normalizer2(IntPtr, JniHandleOwnership)

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
NFCInstance

Returns a Normalizer2 instance for Unicode NFC normalization.

NFDInstance

Returns a Normalizer2 instance for Unicode NFD normalization.

NFKCCasefoldInstance

Returns a Normalizer2 instance for Unicode toNFKC_Casefold() normalization which is equivalent to applying the NFKC_Casefold mappings and then NFC.

NFKCInstance

Returns a Normalizer2 instance for Unicode NFKC normalization.

NFKDInstance

Returns a Normalizer2 instance for Unicode NFKD normalization.

PeerReference (Inherited from Object)
ThresholdClass
ThresholdType

Methods

Append(StringBuilder, ICharSequence)

Appends the second string to the first string (merging them at the boundary) and returns the first string.

Append(StringBuilder, String)

Appends the second string to the first string (merging them at the boundary) and returns the first string.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
ComposePair(Int32, Int32)

Performs pairwise composition of a &amp; b and returns the composite if there is one.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetCombiningClass(Int32)

Gets the combining class of c.

GetDecomposition(Int32)

Gets the decomposition mapping of c.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInstance(Stream, String, Normalizer2+Mode)
GetRawDecomposition(Int32)

Gets the raw decomposition mapping of c.

HasBoundaryAfter(Int32)

Tests if the character always has a normalization boundary after it, regardless of context.

HasBoundaryBefore(Int32)

Tests if the character always has a normalization boundary before it, regardless of context.

IsInert(Int32)

Tests if the character is normalization-inert.

IsNormalized(ICharSequence)

Tests if the string is normalized.

IsNormalized(String)

Tests if the string is normalized.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Normalize(ICharSequence, IAppendable)

Writes the normalized form of the source string to the destination Appendable and returns the destination Appendable.

Normalize(ICharSequence, StringBuilder)

Writes the normalized form of the source string to the destination string (replacing its contents) and returns the destination string.

Normalize(ICharSequence)

Returns the normalized form of the source string.

Normalize(String, IAppendable)

Writes the normalized form of the source string to the destination Appendable and returns the destination Appendable.

Normalize(String, StringBuilder)

Writes the normalized form of the source string to the destination string (replacing its contents) and returns the destination string.

Normalize(String)

Returns the normalized form of the source string.

NormalizeSecondAndAppend(StringBuilder, ICharSequence)

Appends the normalized form of the second string to the first string (merging them at the boundary) and returns the first string.

NormalizeSecondAndAppend(StringBuilder, String)

Appends the normalized form of the second string to the first string (merging them at the boundary) and returns the first string.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
QuickCheck(ICharSequence)
QuickCheck(String)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SpanQuickCheckYes(ICharSequence)

Returns the end of the normalized substring of the input string.

SpanQuickCheckYes(String)

Returns the end of the normalized substring of the input string.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to