Added in API level 29

CaseMap.Fold


public static final class CaseMap.Fold
extends CaseMap

java.lang.Object
   ↳ android.icu.text.CaseMap
     ↳ android.icu.text.CaseMap.Fold


Case folding options and methods. Immutable.

See also:

Summary

Public methods

<A extends Appendable> A apply(CharSequence src, A dest, Edits edits)

Case-folds a string and optionally records edits (see omitUnchangedText()).

String apply(CharSequence src)

Case-folds a string.

CaseMap.Fold omitUnchangedText()

Returns an instance that behaves like this one but omits unchanged text when case-mapping with Edits.

CaseMap.Fold turkic()

Returns an instance that behaves like this one but handles dotted I and dotless i appropriately for Turkic languages (tr, az).

Inherited methods

static CaseMap.Fold fold()
abstract CaseMap omitUnchangedText()

Returns an instance that behaves like this one but omits unchanged text when case-mapping with Edits.

static CaseMap.Lower toLower()
static CaseMap.Title toTitle()
static CaseMap.Upper toUpper()
Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

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

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

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

final void notifyAll()

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

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

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

final void wait(long timeoutMillis)

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

final void wait()

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

Public methods

apply

Added in API level 29
public A apply (CharSequence src, 
                A dest, 
                Edits edits)

Case-folds a string and optionally records edits (see omitUnchangedText()). The result may be longer or shorter than the original.

Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

Parameters
src CharSequence: The original string.

dest A: A buffer for the result string. Must not be null.

edits Edits: Records edits for index mapping, working with styled text, and getting only changes (if any). This function calls edits.reset() first. edits can be null.

Returns
A dest with the result string (or only changes) appended.

apply

Added in API level 29
public String apply (CharSequence src)

Case-folds a string. The result may be longer or shorter than the original.

Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

Parameters
src CharSequence: The original string.

Returns
String the result string.

omitUnchangedText

Added in API level 29
public CaseMap.Fold omitUnchangedText ()

Returns an instance that behaves like this one but omits unchanged text when case-mapping with Edits.

Returns
CaseMap.Fold an options object with this option.

turkic

Added in API level 29
public CaseMap.Fold turkic ()

Returns an instance that behaves like this one but handles dotted I and dotless i appropriately for Turkic languages (tr, az).

Uses the Unicode CaseFolding.txt mappings marked with 'T' that are to be excluded for default mappings and included for the Turkic-specific mappings.

Returns
CaseMap.Fold an options object with this option.