Skip to content

Most visited

Recently visited

navigation
Added in API level 1

NumericShaper

public final class NumericShaper
extends Object implements Serializable

java.lang.Object
   ↳ java.awt.font.NumericShaper


The Class NumericShaper provides methods to convert latin character codes to unicode character codes. For tables of the character codes used, see unicode.org.

Summary

Constants

int ALL_RANGES

The Constant ALL_RANGES indicates all ranges.

int ARABIC

The Constant ARABIC indicates the ARABIC range and decimal base.

int BENGALI

The Constant BENGALI indicates the BENGALI range and decimal base.

int DEVANAGARI

The Constant DEVANAGARI indicates the DEVANAGARI range and decimal base.

int EASTERN_ARABIC

The Constant EASTERN_ARABIC indicates the ARABIC range and ARABIC_EXTENDED decimal base.

int ETHIOPIC

The Constant ETHIOPIC indicates the ETHIOPIC range and decimal base.

int EUROPEAN

The Constant EUROPEAN indicates the latin and extended range, and latin decimal base.

int GUJARATI

The Constant GUJARATI indicates the GUJARATI range and decimal base.

int GURMUKHI

The Constant GURMUKHI indicates the GURMUKHI range and decimal base.

int KANNADA

The Constant KANNADA indicates the KANNADA range and decimal base.

int KHMER

The Constant KHMER indicates the KHMER range and decimal base.

int LAO

The Constant LAO indicates the LAO range and decimal base.

int MALAYALAM

The Constant MALAYALAM indicates the MALAYALAM range and decimal base.

int MONGOLIAN

The Constant MONGOLIAN indicates the MONGOLIAN range and decimal base.

int MYANMAR

The Constant MYANMAR indicates the MYANMAR range and decimal base.

int ORIYA

The Constant ORIYA indicates the ORIYA range and decimal base.

int TAMIL

The Constant TAMIL indicates the TAMIL range and decimal base.

int TELUGU

The Constant TELUGU indicates the TELUGU range and decimal base.

int THAI

The Constant THAI indicates the THAI range and decimal base.

int TIBETAN

The Constant TIBETAN indicates the TIBETAN range and decimal base.

Public methods

boolean equals(Object obj)

Compares this instance with the specified object and indicates if they are equal.

static NumericShaper getContextualShaper(int ranges)

Gets the NumericShaper for the specified unicode ranges.

static NumericShaper getContextualShaper(int ranges, int defaultContext)

Gets the NumericShaper for the specified unicode ranges and default unicode range.

int getRanges()

Gets the masks for all of the ranges supported by this NumericShaper, packed into an int value using the logical OR logical operation for multiple ranges: NumericShaper.DEVANAGARI | NumericShaper.BENGALI.

static NumericShaper getShaper(int singleRange)

Gets a NumericShaper for the specified unicode range.

int hashCode()

Returns an integer hash code for this object.

boolean isContextual()

Checks if this NumericShaper is contextual (supporting multiple script ranges) or not.

void shape(char[] text, int start, int count, int context)

Transforms the encoding of the text, starting from the character at index start and transforming count characters, using the specified context.

void shape(char[] text, int start, int count)

Transforms the encoding of the text, starting from the character at index start and transforming count characters.

String toString()

Returns a string containing a concise, human-readable description of this object.

Inherited methods

From class java.lang.Object

Constants

ALL_RANGES

Added in API level 1
int ALL_RANGES

The Constant ALL_RANGES indicates all ranges.

Constant Value: 524287 (0x0007ffff)

ARABIC

Added in API level 1
int ARABIC

The Constant ARABIC indicates the ARABIC range and decimal base.

Constant Value: 2 (0x00000002)

BENGALI

Added in API level 1
int BENGALI

The Constant BENGALI indicates the BENGALI range and decimal base.

Constant Value: 16 (0x00000010)

DEVANAGARI

Added in API level 1
int DEVANAGARI

The Constant DEVANAGARI indicates the DEVANAGARI range and decimal base.

Constant Value: 8 (0x00000008)

EASTERN_ARABIC

Added in API level 1
int EASTERN_ARABIC

The Constant EASTERN_ARABIC indicates the ARABIC range and ARABIC_EXTENDED decimal base.

Constant Value: 4 (0x00000004)

ETHIOPIC

Added in API level 1
int ETHIOPIC

The Constant ETHIOPIC indicates the ETHIOPIC range and decimal base.

Constant Value: 65536 (0x00010000)

EUROPEAN

Added in API level 1
int EUROPEAN

The Constant EUROPEAN indicates the latin and extended range, and latin decimal base.

Constant Value: 1 (0x00000001)

GUJARATI

Added in API level 1
int GUJARATI

The Constant GUJARATI indicates the GUJARATI range and decimal base.

Constant Value: 64 (0x00000040)

GURMUKHI

Added in API level 1
int GURMUKHI

The Constant GURMUKHI indicates the GURMUKHI range and decimal base.

Constant Value: 32 (0x00000020)

KANNADA

Added in API level 1
int KANNADA

The Constant KANNADA indicates the KANNADA range and decimal base.

Constant Value: 1024 (0x00000400)

KHMER

Added in API level 1
int KHMER

The Constant KHMER indicates the KHMER range and decimal base.

Constant Value: 131072 (0x00020000)

LAO

Added in API level 1
int LAO

The Constant LAO indicates the LAO range and decimal base.

Constant Value: 8192 (0x00002000)

MALAYALAM

Added in API level 1
int MALAYALAM

The Constant MALAYALAM indicates the MALAYALAM range and decimal base.

Constant Value: 2048 (0x00000800)

MONGOLIAN

Added in API level 1
int MONGOLIAN

The Constant MONGOLIAN indicates the MONGOLIAN range and decimal base.

Constant Value: 262144 (0x00040000)

MYANMAR

Added in API level 1
int MYANMAR

The Constant MYANMAR indicates the MYANMAR range and decimal base.

Constant Value: 32768 (0x00008000)

ORIYA

Added in API level 1
int ORIYA

The Constant ORIYA indicates the ORIYA range and decimal base.

Constant Value: 128 (0x00000080)

TAMIL

Added in API level 1
int TAMIL

The Constant TAMIL indicates the TAMIL range and decimal base.

Constant Value: 256 (0x00000100)

TELUGU

Added in API level 1
int TELUGU

The Constant TELUGU indicates the TELUGU range and decimal base.

Constant Value: 512 (0x00000200)

THAI

Added in API level 1
int THAI

The Constant THAI indicates the THAI range and decimal base.

Constant Value: 4096 (0x00001000)

TIBETAN

Added in API level 1
int TIBETAN

The Constant TIBETAN indicates the TIBETAN range and decimal base.

Constant Value: 16384 (0x00004000)

Public methods

equals

Added in API level 1
boolean equals (Object obj)

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
obj Object: the object to compare this instance with.
Returns
boolean true if the specified object is equal to this Object; false otherwise.

getContextualShaper

Added in API level 1
NumericShaper getContextualShaper (int ranges)

Gets the NumericShaper for the specified unicode ranges. The OR logical operation should be used for multiple ranges: NumericShaper.DEVANAGARI | NumericShaper.BENGALI. The NumericShaper returned by this method is contextual in that it supports multiple character ranges, depending on the context.

Parameters
ranges int: the unicode ranges.
Returns
NumericShaper the NumericShaper for the specified ranges.

getContextualShaper

Added in API level 1
NumericShaper getContextualShaper (int ranges, 
                int defaultContext)

Gets the NumericShaper for the specified unicode ranges and default unicode range. The defaultContext parameter is used as the starting context (which indicates the language/script being used). The OR logical operation should be used for multiple ranges: NumericShaper.DEVANAGARI | NumericShaper.BENGALI. The NumericShaper returned by this method is contextual in that it supports multiple character ranges, depending on the context.

Parameters
ranges int: the unicode ranges.
defaultContext int: the default, starting context.
Returns
NumericShaper the NumericShaper for the specified ranges.

getRanges

Added in API level 1
int getRanges ()

Gets the masks for all of the ranges supported by this NumericShaper, packed into an int value using the logical OR logical operation for multiple ranges: NumericShaper.DEVANAGARI | NumericShaper.BENGALI.

Returns
int all ranges of this NumericShaper.

getShaper

Added in API level 1
NumericShaper getShaper (int singleRange)

Gets a NumericShaper for the specified unicode range. The NumericShaper supports only a single range and hence is not contextual.

Parameters
singleRange int: the specified unicode single range.
Returns
NumericShaper the NumericShaper for the specified unicode range.

hashCode

Added in API level 1
int hashCode ()

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
int this object's hash code.

isContextual

Added in API level 1
boolean isContextual ()

Checks if this NumericShaper is contextual (supporting multiple script ranges) or not.

Returns
boolean true, if this NumericShaper is contextual, false otherwise.

shape

Added in API level 1
void shape (char[] text, 
                int start, 
                int count, 
                int context)

Transforms the encoding of the text, starting from the character at index start and transforming count characters, using the specified context.

Parameters
text char: the text to be shaped.
start int: the start offset of the text.
count int: the number of characters to be shaped.
context int: the context to be used for shaping.

shape

Added in API level 1
void shape (char[] text, 
                int start, 
                int count)

Transforms the encoding of the text, starting from the character at index start and transforming count characters.

Parameters
text char: the text to be shaped.
start int: the start offset of the text.
count int: the number of characters to be shaped.

toString

Added in API level 1
String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
String a printable representation of this object.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.