APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.awt.font

public final Class NumericShaper

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .ObjectOutputStream, .Serial, java.util.Arrays, .Comparator, .EnumSet, .Set, jdk.internal.access.SharedSecrets

The NumericShaper class is used to convert Latin-1 (European) digits to other Unicode decimal digits. Users of this class will primarily be people who wish to present data using national digit shapes, but find it more convenient to represent the data internally using Latin-1 (European) digits. This does not interpret the deprecated numeric shape selector character (U+206E).

Instances of NumericShaper are typically applied as attributes to text with the NUMERIC_SHAPING attribute of the TextAttribute class. For example, this code snippet causes a TextLayout to shape European digits to Arabic in an Arabic context:

Map map = new HashMap();
map.put(TextAttribute.NUMERIC_SHAPING,
    NumericShaper.getContextualShaper(NumericShaper.ARABIC));
FontRenderContext frc = ...;
TextLayout layout = new TextLayout(text, map, frc);
layout.draw(g2d, x, y);

It is also possible to perform numeric shaping explicitly using instances of NumericShaper, as this code snippet demonstrates:
char[] text = ...;
// shape all EUROPEAN digits (except zero) to ARABIC digits
NumericShaper shaper = NumericShaper.getShaper(NumericShaper.ARABIC);
shaper.shape(text, start, count);

// shape European digits to ARABIC digits if preceding text is Arabic, or
// shape European digits to TAMIL digits if preceding text is Tamil, or
// leave European digits alone if there is no preceding text, or
// preceding text is neither Arabic nor Tamil
NumericShaper shaper =
    NumericShaper.getContextualShaper(NumericShaper.ARABIC |
                                        NumericShaper.TAMIL,
                                      NumericShaper.EUROPEAN);
shaper.shape(text, start, count);

Bit mask- and enum-based Unicode ranges

This class supports two different programming interfaces to represent Unicode ranges for script-specific digits: bit mask-based ones, such as NumericShaper.ARABIC, and enum-based ones, such as NumericShaper.Range#ARABIC. Multiple ranges can be specified by ORing bit mask-based constants, such as:

NumericShaper.ARABIC | NumericShaper.TAMIL
or creating a Set with the NumericShaper.Range constants, such as:
EnumSet.of(NumericShaper.Range.ARABIC, NumericShaper.Range.TAMIL)
The enum-based ranges are a super set of the bit mask-based ones.

If the two interfaces are mixed (including serialization), Unicode range values are mapped to their counterparts where such mapping is possible, such as NumericShaper.Range.ARABIC from/to NumericShaper.ARABIC. If any unmappable range values are specified, such as NumericShaper.Range.BALINESE, those ranges are ignored.

Decimal Digits Precedence

A Unicode range may have more than one set of decimal digits. If multiple decimal digits sets are specified for the same Unicode range, one of the sets will take precedence as follows.

NumericShaper constants precedence
Unicode Range NumericShaper Constants Precedence
Arabic NumericShaper.ARABIC
NumericShaper.EASTERN_ARABIC
NumericShaper.EASTERN_ARABIC
NumericShaper.Range#ARABIC
NumericShaper.Range#EASTERN_ARABIC
NumericShaper.Range#EASTERN_ARABIC
Tai Tham NumericShaper.Range#TAI_THAM_HORA
NumericShaper.Range#TAI_THAM_THAM
NumericShaper.Range#TAI_THAM_THAM
Since
1.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
NumericShaper.Range

A NumericShaper.Range represents a Unicode range of a script having its own decimal digits.

Field Summary

Modifier and TypeField and Description
public static final int
ALL_RANGES

Identifies all ranges, for full contextual shaping.

public static final int
ARABIC

Identifies the ARABIC range and decimal base.

private static final int
private static final char[]
public static final int
BENGALI

Identifies the BENGALI range and decimal base.

private static final int
private static final int
BSEARCH_THRESHOLD

If more than BSEARCH_THRESHOLD ranges are specified, binary search is used.

private static final char[]
private static final int
private static int
private static final int
private transient volatile NumericShaper.Range
public static final int
DEVANAGARI

Identifies the DEVANAGARI range and decimal base.

private static final int
public static final int
EASTERN_ARABIC

Identifies the ARABIC range and ARABIC_EXTENDED decimal base.

private static final int
public static final int
ETHIOPIC

Identifies the ETHIOPIC range and decimal base.

private static final int
public static final int
EUROPEAN

Identifies the Latin-1 (European) and extended range, and Latin-1 (European) decimal base.

private static final int
public static final int
GUJARATI

Identifies the GUJARATI range and decimal base.

private static final int
public static final int
GURMUKHI

Identifies the GURMUKHI range and decimal base.

private static final int
public static final int
KANNADA

Identifies the KANNADA range and decimal base.

private static final int
private int
public static final int
KHMER

Identifies the KHMER range and decimal base.

private static final int
public static final int
LAO

Identifies the LAO range and decimal base.

private static final int
public static final int
MALAYALAM

Identifies the MALAYALAM range and decimal base.

private static final int
private int
public static final int
MONGOLIAN

Identifies the MONGOLIAN range and decimal base.

private static final int
public static final int
MYANMAR

Identifies the MYANMAR range and decimal base.

private static final int
private static final int
public static final int
ORIYA

Identifies the ORIYA range and decimal base.

private static final int
private transient NumericShaper.Range[]
rangeArray

rangeSet.toArray() value.

private transient Set<NumericShaper.Range>
rangeSet

Set<Range> indicating which Unicode ranges to shape.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.7 for interoperability.

private NumericShaper.Range
private transient volatile int
private static int[]
public static final int
TAMIL

Identifies the TAMIL range and decimal base.

private static final int
public static final int
TELUGU

Identifies the TELUGU range and decimal base.

private static final int
public static final int
THAI

Identifies the THAI range and decimal base.

private static final int
public static final int
TIBETAN

Identifies the TIBETAN range and decimal base.

private static final int

Constructor Summary

AccessConstructor and Description
private
NumericShaper(int key, int mask)

Private constructor.

private

Method Summary

Modifier and TypeMethod and Description
private void
checkParams(char[] text, int start, int count)

public boolean

Returns:

true if o is an instance of NumericShaper and shapes in the same way; false otherwise.
equals
(Object
the specified object to compare to this NumericShaper
o
)

Overrides java.lang.Object.equals.

Returns true if the specified object is an instance of NumericShaper and shapes identically to this one, regardless of the range representations, the bit mask or the enum.

private static int
getContextKey(char c)

public static NumericShaper

Returns:

a shaper for the specified ranges
getContextualShaper
(int
the specified Unicode ranges
ranges
)

Returns a contextual shaper for the provided unicode range(s).

public static NumericShaper

Returns:

a contextual shaper for the specified ranges
getContextualShaper
(Set<NumericShaper.Range>
the specified Unicode ranges
ranges
)

Returns a contextual shaper for the provided Unicode range(s).

public static NumericShaper

Returns:

a shaper for the specified Unicode ranges.
getContextualShaper
(int
the specified Unicode ranges
ranges
,
int
the starting context, such as NumericShaper.EUROPEAN
defaultContext
)

Returns a contextual shaper for the provided unicode range(s).

public static NumericShaper

Returns:

a contextual shaper for the specified Unicode ranges.
getContextualShaper
(Set<NumericShaper.Range>
the specified Unicode ranges
ranges
,
NumericShaper.Range
the starting context, such as NumericShaper.Range.EUROPEAN
defaultContext
)

Returns a contextual shaper for the provided Unicode range(s).

private static int
getHighBit(int value)

Returns the index of the high bit in value (assuming le, actually power of 2 >= value).

private static int
getKeyFromMask(int mask)

public int

Returns:

the values for all the ranges to be shaped.
getRanges
()

Returns an int that ORs together the values for all the ranges that will be shaped.

public Set<NumericShaper.Range>

Returns:

all the Unicode ranges to be shaped.
getRangeSet
()

Returns a Set representing all the Unicode ranges in this NumericShaper that will be shaped.

public static NumericShaper

Returns:

a non-contextual numeric shaper
getShaper
(int
the specified Unicode range
singleRange
)

Returns a shaper for the provided unicode range.

public static NumericShaper

Returns:

a non-contextual NumericShaper.
getShaper
(NumericShaper.Range
the Unicode range given by a NumericShaper.Range constant.
singleRange
)

Returns a shaper for the provided Unicode range.

public int

Returns:

this shaper's hash code.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this shaper.

public boolean

Returns:

true if this shaper is contextual; false otherwise.
isContextual
()

Returns a boolean indicating whether or not this shaper shapes contextually.

private boolean
private NumericShaper.Range
rangeForCodePoint(final int codepoint)

private static int
search(int value, int[] array, int start, int length)

fast binary search over subrange of array.

public void
shape(char[]
an array of characters to convert
text
,
int
the index into text to start converting
start
,
int
the number of characters in text to convert
count
)

Converts the digits in the text that occur between start and start + count.

public void
shape(char[]
an array of characters
text
,
int
the index into text to start converting
start
,
int
the number of characters in text to convert
count
,
int
the context to which to convert the characters, such as NumericShaper.EUROPEAN
context
)

Converts the digits in the text that occur between start and start + count, using the provided context.

public void
shape(char[]
a char array
text
,
int
the index into text to start converting
start
,
int
the number of chars in text to convert
count
,
NumericShaper.Range
the context to which to convert the characters, such as NumericShaper.Range.EUROPEAN
context
)

Converts the digits in the text that occur between start and start + count, using the provided context.

private synchronized void
shapeContextually(char[] text, int start, int count, int ctxKey)

Perform contextual shaping.

private void
shapeContextually(char[] text, int start, int count, NumericShaper.Range ctxKey)

private void
shapeNonContextually(char[] text, int start, int count)

Perform non-contextual shaping.

public String

Returns:

a String describing this shaper.
toString
()

Overrides java.lang.Object.toString.

Returns a String that describes this shaper.

private void
writeObject(ObjectOutputStream
the output stream to write to
stream
)

Converts the NumericShaper.Range enum-based parameters, if any, to the bit mask-based counterparts and writes this object to the stream.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ALL_RANGESback to summary
public static final int ALL_RANGES

Identifies all ranges, for full contextual shaping.

This constant specifies all of the bit mask-based ranges. Use EnumSet.allOf(NumericShaper.Range.class) to specify all of the enum-based ranges.

ARABICback to summary
public static final int ARABIC

Identifies the ARABIC range and decimal base.

ARABIC_KEYback to summary
private static final int ARABIC_KEY
basesback to summary
private static final char[] bases
BENGALIback to summary
public static final int BENGALI

Identifies the BENGALI range and decimal base.

BENGALI_KEYback to summary
private static final int BENGALI_KEY
BSEARCH_THRESHOLDback to summary
private static final int BSEARCH_THRESHOLD

If more than BSEARCH_THRESHOLD ranges are specified, binary search is used.

contextsback to summary
private static final char[] contexts
CONTEXTUAL_MASKback to summary
private static final int CONTEXTUAL_MASK
ctCacheback to summary
private static int ctCache
ctCacheLimitback to summary
private static final int ctCacheLimit
currentRangeback to summary
private transient volatile NumericShaper.Range currentRange
DEVANAGARIback to summary
public static final int DEVANAGARI

Identifies the DEVANAGARI range and decimal base.

DEVANAGARI_KEYback to summary
private static final int DEVANAGARI_KEY
EASTERN_ARABICback to summary
public static final int EASTERN_ARABIC

Identifies the ARABIC range and ARABIC_EXTENDED decimal base.

EASTERN_ARABIC_KEYback to summary
private static final int EASTERN_ARABIC_KEY
ETHIOPICback to summary
public static final int ETHIOPIC

Identifies the ETHIOPIC range and decimal base.

ETHIOPIC_KEYback to summary
private static final int ETHIOPIC_KEY
EUROPEANback to summary
public static final int EUROPEAN

Identifies the Latin-1 (European) and extended range, and Latin-1 (European) decimal base.

EUROPEAN_KEYback to summary
private static final int EUROPEAN_KEY
GUJARATIback to summary
public static final int GUJARATI

Identifies the GUJARATI range and decimal base.

GUJARATI_KEYback to summary
private static final int GUJARATI_KEY
GURMUKHIback to summary
public static final int GURMUKHI

Identifies the GURMUKHI range and decimal base.

GURMUKHI_KEYback to summary
private static final int GURMUKHI_KEY
KANNADAback to summary
public static final int KANNADA

Identifies the KANNADA range and decimal base.

KANNADA_KEYback to summary
private static final int KANNADA_KEY
keyback to summary
private int key
KHMERback to summary
public static final int KHMER

Identifies the KHMER range and decimal base.

KHMER_KEYback to summary
private static final int KHMER_KEY
LAOback to summary
public static final int LAO

Identifies the LAO range and decimal base.

LAO_KEYback to summary
private static final int LAO_KEY
MALAYALAMback to summary
public static final int MALAYALAM

Identifies the MALAYALAM range and decimal base.

MALAYALAM_KEYback to summary
private static final int MALAYALAM_KEY
maskback to summary
private int mask
MONGOLIANback to summary
public static final int MONGOLIAN

Identifies the MONGOLIAN range and decimal base.

MONGOLIAN_KEYback to summary
private static final int MONGOLIAN_KEY
MYANMARback to summary
public static final int MYANMAR

Identifies the MYANMAR range and decimal base.

MYANMAR_KEYback to summary
private static final int MYANMAR_KEY
NUM_KEYSback to summary
private static final int NUM_KEYS
ORIYAback to summary
public static final int ORIYA

Identifies the ORIYA range and decimal base.

ORIYA_KEYback to summary
private static final int ORIYA_KEY
rangeArrayback to summary
private transient NumericShaper.Range[] rangeArray

rangeSet.toArray() value. Sorted by Range.base when the number of elements is greater than BSEARCH_THRESHOLD.

rangeSetback to summary
private transient Set<NumericShaper.Range> rangeSet

Set<Range> indicating which Unicode ranges to shape. null for the bit mask-based API.

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.7 for interoperability.

Annotations
@Serial
shapingRangeback to summary
private NumericShaper.Range shapingRange
Since
1.7
stCacheback to summary
private transient volatile int stCache
strongTableback to summary
private static int[] strongTable
TAMILback to summary
public static final int TAMIL

Identifies the TAMIL range and decimal base.

TAMIL_KEYback to summary
private static final int TAMIL_KEY
TELUGUback to summary
public static final int TELUGU

Identifies the TELUGU range and decimal base.

TELUGU_KEYback to summary
private static final int TELUGU_KEY
THAIback to summary
public static final int THAI

Identifies the THAI range and decimal base.

THAI_KEYback to summary
private static final int THAI_KEY
TIBETANback to summary
public static final int TIBETAN

Identifies the TIBETAN range and decimal base.

TIBETAN_KEYback to summary
private static final int TIBETAN_KEY

Constructor Detail

NumericShaperback to summary
private NumericShaper(int key, int mask)

Private constructor.

NumericShaperback to summary
private NumericShaper(NumericShaper.Range defaultContext, Set<NumericShaper.Range> ranges)

Method Detail

checkParamsback to summary
private void checkParams(char[] text, int start, int count)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Returns true if the specified object is an instance of NumericShaper and shapes identically to this one, regardless of the range representations, the bit mask or the enum. For example, the following code produces "true".

NumericShaper ns1 = NumericShaper.getShaper(NumericShaper.ARABIC);
NumericShaper ns2 = NumericShaper.getShaper(NumericShaper.Range.ARABIC);
System.out.println(ns1.equals(ns2));
Parameters
o:Object

the specified object to compare to this NumericShaper

Returns:boolean

true if o is an instance of NumericShaper and shapes in the same way; false otherwise.

See Also
java.lang.Object#equals(java.lang.Object)
getContextKeyback to summary
private static int getContextKey(char c)
getContextualShaperback to summary
public static NumericShaper getContextualShaper(int ranges)

Returns a contextual shaper for the provided unicode range(s). Latin-1 (EUROPEAN) digits are converted to the decimal digits corresponding to the range of the preceding text, if the range is one of the provided ranges. Multiple ranges are represented by or-ing the values together, such as, NumericShaper.ARABIC | NumericShaper.THAI. The shaper assumes EUROPEAN as the starting context, that is, if EUROPEAN digits are encountered before any strong directional text in the string, the context is presumed to be EUROPEAN, and so the digits will not shape. Any bit set in the ranges bitmask which is not a recognised value is discarded. Similarly if two bits are specified where one takes precedence, the lesser one is discarded.

Parameters
ranges:int

the specified Unicode ranges

Returns:NumericShaper

a shaper for the specified ranges

getContextualShaperback to summary
public static NumericShaper getContextualShaper(Set<NumericShaper.Range> ranges)

Returns a contextual shaper for the provided Unicode range(s). The Latin-1 (EUROPEAN) digits are converted to the decimal digits corresponding to the range of the preceding text, if the range is one of the provided ranges.

The shaper assumes EUROPEAN as the starting context, that is, if EUROPEAN digits are encountered before any strong directional text in the string, the context is presumed to be EUROPEAN, and so the digits will not shape. If two ranges are specified where one takes precedence over the other the lesser range is discarded.

Parameters
ranges:Set<NumericShaper.Range>

the specified Unicode ranges

Returns:NumericShaper

a contextual shaper for the specified ranges

Exceptions
NullPointerException:
if ranges is null.
Since
1.7
getContextualShaperback to summary
public static NumericShaper getContextualShaper(int ranges, int defaultContext)

Returns a contextual shaper for the provided unicode range(s). Latin-1 (EUROPEAN) digits will be converted to the decimal digits corresponding to the range of the preceding text, if the range is one of the provided ranges. Multiple ranges are represented by or-ing the values together, for example, NumericShaper.ARABIC | NumericShaper.THAI. The shaper uses defaultContext as the starting context.

Parameters
ranges:int

the specified Unicode ranges

defaultContext:int

the starting context, such as NumericShaper.EUROPEAN

Returns:NumericShaper

a shaper for the specified Unicode ranges.

Exceptions
IllegalArgumentException:
if the specified defaultContext is not a single valid range.
getContextualShaperback to summary
public static NumericShaper getContextualShaper(Set<NumericShaper.Range> ranges, NumericShaper.Range defaultContext)

Returns a contextual shaper for the provided Unicode range(s). The Latin-1 (EUROPEAN) digits will be converted to the decimal digits corresponding to the range of the preceding text, if the range is one of the provided ranges. The shaper uses defaultContext as the starting context. If two ranges are specified where one takes precedence over the other the lesser range is discarded.

Parameters
ranges:Set<NumericShaper.Range>

the specified Unicode ranges

defaultContext:NumericShaper.Range

the starting context, such as NumericShaper.Range.EUROPEAN

Returns:NumericShaper

a contextual shaper for the specified Unicode ranges.

Exceptions
NullPointerException:
if ranges or defaultContext is null
Since
1.7
getHighBitback to summary
private static int getHighBit(int value)

Returns the index of the high bit in value (assuming le, actually power of 2 >= value). value must be positive.

getKeyFromMaskback to summary
private static int getKeyFromMask(int mask)
getRangesback to summary
public int getRanges()

Returns an int that ORs together the values for all the ranges that will be shaped.

For example, to check if a shaper shapes to Arabic, you would use the following:

if ((shaper.getRanges() & shaper.ARABIC) != 0) { ...

Note that this method supports only the bit mask-based ranges. Call getRangeSet() for the enum-based ranges.

Returns:int

the values for all the ranges to be shaped.

getRangeSetback to summary
public Set<NumericShaper.Range> getRangeSet()

Returns a Set representing all the Unicode ranges in this NumericShaper that will be shaped.

Returns:Set<NumericShaper.Range>

all the Unicode ranges to be shaped.

Since
1.7
getShaperback to summary
public static NumericShaper getShaper(int singleRange)

Returns a shaper for the provided unicode range. All Latin-1 (EUROPEAN) digits are converted to the corresponding decimal unicode digits.

Parameters
singleRange:int

the specified Unicode range

Returns:NumericShaper

a non-contextual numeric shaper

Exceptions
IllegalArgumentException:
if the range is not a single range
getShaperback to summary
public static NumericShaper getShaper(NumericShaper.Range singleRange)

Returns a shaper for the provided Unicode range. All Latin-1 (EUROPEAN) digits are converted to the corresponding decimal digits of the specified Unicode range.

Parameters
singleRange:NumericShaper.Range

the Unicode range given by a NumericShaper.Range constant.

Returns:NumericShaper

a non-contextual NumericShaper.

Exceptions
NullPointerException:
if singleRange is null
Since
1.7
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this shaper.

Returns:int

this shaper's hash code.

See Also
java.lang.Object#hashCode
isContextualback to summary
public boolean isContextual()

Returns a boolean indicating whether or not this shaper shapes contextually.

Returns:boolean

true if this shaper is contextual; false otherwise.

isStrongDirectionalback to summary
private boolean isStrongDirectional(char c)
rangeForCodePointback to summary
private NumericShaper.Range rangeForCodePoint(final int codepoint)
searchback to summary
private static int search(int value, int[] array, int start, int length)

fast binary search over subrange of array.

shapeback to summary
public void shape(char[] text, int start, int count)

Converts the digits in the text that occur between start and start + count.

Parameters
text:char[]

an array of characters to convert

start:int

the index into text to start converting

count:int

the number of characters in text to convert

Exceptions
IndexOutOfBoundsException:
if start or start + count is out of bounds
NullPointerException:
if text is null
shapeback to summary
public void shape(char[] text, int start, int count, int context)

Converts the digits in the text that occur between start and start + count, using the provided context. Context is ignored if the shaper is not a contextual shaper.

Parameters
text:char[]

an array of characters

start:int

the index into text to start converting

count:int

the number of characters in text to convert

context:int

the context to which to convert the characters, such as NumericShaper.EUROPEAN

Exceptions
IndexOutOfBoundsException:
if start or start + count is out of bounds
NullPointerException:
if text is null
IllegalArgumentException:
if this is a contextual shaper and the specified context is not a single valid range.
shapeback to summary
public void shape(char[] text, int start, int count, NumericShaper.Range context)

Converts the digits in the text that occur between start and start + count, using the provided context. Context is ignored if the shaper is not a contextual shaper.

Parameters
text:char[]

a char array

start:int

the index into text to start converting

count:int

the number of chars in text to convert

context:NumericShaper.Range

the context to which to convert the characters, such as NumericShaper.Range.EUROPEAN

Exceptions
IndexOutOfBoundsException:
if start or start + count is out of bounds
NullPointerException:
if text or context is null
Since
1.7
shapeContextuallyback to summary
private synchronized void shapeContextually(char[] text, int start, int count, int ctxKey)

Perform contextual shaping. Synchronized to protect caches used in getContextKey.

shapeContextuallyback to summary
private void shapeContextually(char[] text, int start, int count, NumericShaper.Range ctxKey)
shapeNonContextuallyback to summary
private void shapeNonContextually(char[] text, int start, int count)

Perform non-contextual shaping.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String that describes this shaper. This method is used for debugging purposes only.

Returns:String

a String describing this shaper.

writeObjectback to summary
private void writeObject(ObjectOutputStream stream) throws IOException

Converts the NumericShaper.Range enum-based parameters, if any, to the bit mask-based counterparts and writes this object to the stream. Any enum constants that have no bit mask-based counterparts are ignored in the conversion.

Parameters
stream:ObjectOutputStream

the output stream to write to

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs while writing to stream
Since
1.7
java.awt.font back to summary

public sealed Enum NumericShaper.Range

extends Enum<NumericShaper.Range>
Class Inheritance

A NumericShaper.Range represents a Unicode range of a script having its own decimal digits. For example, the NumericShaper.Range#THAI range has the Thai digits, THAI DIGIT ZERO (U+0E50) to THAI DIGIT NINE (U+0E59).

The Range enum replaces the traditional bit mask-based values (e.g., NumericShaper#ARABIC), and supports more Unicode ranges than the bit mask-based ones. For example, the following code using the bit mask:

NumericShaper.getContextualShaper(NumericShaper.ARABIC |
                                    NumericShaper.TAMIL,
                                  NumericShaper.EUROPEAN);
can be written using this enum as:
NumericShaper.getContextualShaper(EnumSet.of(
                                    NumericShaper.Range.ARABIC,
                                    NumericShaper.Range.TAMIL),
                                  NumericShaper.Range.EUROPEAN);
Since
1.7

Field Summary

Modifier and TypeField and Description
public static final NumericShaper.Range
ARABIC

The Arabic range with the Arabic-Indic digits.

public static final NumericShaper.Range
BALINESE

The Balinese range with the Balinese digits.

private final int
public static final NumericShaper.Range
BENGALI

The Bengali range with the Bengali digits.

public static final NumericShaper.Range
CHAM

The Cham range with the Cham digits.

public static final NumericShaper.Range
DEVANAGARI

The Devanagari range with the Devanagari digits.

public static final NumericShaper.Range
EASTERN_ARABIC

The Arabic range with the Eastern Arabic-Indic digits.

private final int
public static final NumericShaper.Range
ETHIOPIC

The Ethiopic range with the Ethiopic digits.

public static final NumericShaper.Range
EUROPEAN

The Latin (European) range with the Latin (ASCII) digits.

public static final NumericShaper.Range
GUJARATI

The Gujarati range with the Gujarati digits.

public static final NumericShaper.Range
GURMUKHI

The Gurmukhi range with the Gurmukhi digits.

public static final NumericShaper.Range
JAVANESE

The Javanese range with the Javanese digits.

public static final NumericShaper.Range
KANNADA

The Kannada range with the Kannada digits.

public static final NumericShaper.Range
KAYAH_LI

The Kayah Li range with the Kayah Li digits.

public static final NumericShaper.Range
KHMER

The Khmer range with the Khmer digits.

public static final NumericShaper.Range
LAO

The Lao range with the Lao digits.

public static final NumericShaper.Range
LEPCHA

The Lepcha range with the Lepcha digits.

public static final NumericShaper.Range
LIMBU

The Limbu range with the Limbu digits.

public static final NumericShaper.Range
MALAYALAM

The Malayalam range with the Malayalam digits.

public static final NumericShaper.Range
MEETEI_MAYEK

The Meetei Mayek range with the Meetei Mayek digits.

public static final NumericShaper.Range
MONGOLIAN

The Mongolian range with the Mongolian digits.

public static final NumericShaper.Range
MYANMAR

The Myanmar range with the Myanmar digits.

public static final NumericShaper.Range
MYANMAR_SHAN

The Myanmar range with the Myanmar Shan digits.

public static final NumericShaper.Range
MYANMAR_TAI_LAING

The Myanmar Extended-B range with the Myanmar Tai Laing digits.

public static final NumericShaper.Range
NEW_TAI_LUE

The New Tai Lue range with the New Tai Lue digits.

public static final NumericShaper.Range
NKO

The N'Ko range with the N'Ko digits.

public static final NumericShaper.Range
OL_CHIKI

The Ol Chiki range with the Ol Chiki digits.

public static final NumericShaper.Range
ORIYA

The Oriya range with the Oriya digits.

public static final NumericShaper.Range
SAURASHTRA

The Saurashtra range with the Saurashtra digits.

public static final NumericShaper.Range
SINHALA

The Sinhala range with the Sinhala digits.

private final int
public static final NumericShaper.Range
SUNDANESE

The Sundanese range with the Sundanese digits.

public static final NumericShaper.Range
TAI_THAM_HORA

The Tai Tham Hora range with the Tai Tham Hora digits.

public static final NumericShaper.Range
TAI_THAM_THAM

The Tai Tham Tham range with the Tai Tham Tham digits.

public static final NumericShaper.Range
TAMIL

The Tamil range with the Tamil digits.

public static final NumericShaper.Range
TELUGU

The Telugu range with the Telugu digits.

public static final NumericShaper.Range
THAI

The Thai range with the Thai digits.

public static final NumericShaper.Range
TIBETAN

The Tibetan range with the Tibetan digits.

public static final NumericShaper.Range
VAI

The Vai range with the Vai digits.

Constructor Summary

AccessConstructor and Description
private
Range(int base, int start, int end)

Method Summary

Modifier and TypeMethod and Description
private int
pack-priv char
private static NumericShaper.Range
indexToRange(int index)

private boolean
inRange(int c)

private static Set<NumericShaper.Range>
maskToRangeSet(int mask)

private static int
private static int
private static int
public static NumericShaper.Range
public static NumericShaper.Range[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ARABICback to summary
public static final NumericShaper.Range ARABIC

The Arabic range with the Arabic-Indic digits.

BALINESEback to summary
public static final NumericShaper.Range BALINESE

The Balinese range with the Balinese digits.

baseback to summary
private final int base
BENGALIback to summary
public static final NumericShaper.Range BENGALI

The Bengali range with the Bengali digits.

CHAMback to summary
public static final NumericShaper.Range CHAM

The Cham range with the Cham digits.

DEVANAGARIback to summary
public static final NumericShaper.Range DEVANAGARI

The Devanagari range with the Devanagari digits.

EASTERN_ARABICback to summary
public static final NumericShaper.Range EASTERN_ARABIC

The Arabic range with the Eastern Arabic-Indic digits.

endback to summary
private final int end
ETHIOPICback to summary
public static final NumericShaper.Range ETHIOPIC

The Ethiopic range with the Ethiopic digits. Ethiopic does not have a decimal digit 0 so Latin (European) 0 is used.

EUROPEANback to summary
public static final NumericShaper.Range EUROPEAN

The Latin (European) range with the Latin (ASCII) digits.

GUJARATIback to summary
public static final NumericShaper.Range GUJARATI

The Gujarati range with the Gujarati digits.

GURMUKHIback to summary
public static final NumericShaper.Range GURMUKHI

The Gurmukhi range with the Gurmukhi digits.

JAVANESEback to summary
public static final NumericShaper.Range JAVANESE

The Javanese range with the Javanese digits.

KANNADAback to summary
public static final NumericShaper.Range KANNADA

The Kannada range with the Kannada digits.

KAYAH_LIback to summary
public static final NumericShaper.Range KAYAH_LI

The Kayah Li range with the Kayah Li digits.

KHMERback to summary
public static final NumericShaper.Range KHMER

The Khmer range with the Khmer digits.

LAOback to summary
public static final NumericShaper.Range LAO

The Lao range with the Lao digits.

LEPCHAback to summary
public static final NumericShaper.Range LEPCHA

The Lepcha range with the Lepcha digits.

LIMBUback to summary
public static final NumericShaper.Range LIMBU

The Limbu range with the Limbu digits.

MALAYALAMback to summary
public static final NumericShaper.Range MALAYALAM

The Malayalam range with the Malayalam digits.

MEETEI_MAYEKback to summary
public static final NumericShaper.Range MEETEI_MAYEK

The Meetei Mayek range with the Meetei Mayek digits.

MONGOLIANback to summary
public static final NumericShaper.Range MONGOLIAN

The Mongolian range with the Mongolian digits.

MYANMARback to summary
public static final NumericShaper.Range MYANMAR

The Myanmar range with the Myanmar digits.

MYANMAR_SHANback to summary
public static final NumericShaper.Range MYANMAR_SHAN

The Myanmar range with the Myanmar Shan digits.

MYANMAR_TAI_LAINGback to summary
public static final NumericShaper.Range MYANMAR_TAI_LAING

The Myanmar Extended-B range with the Myanmar Tai Laing digits.

Since
9
NEW_TAI_LUEback to summary
public static final NumericShaper.Range NEW_TAI_LUE

The New Tai Lue range with the New Tai Lue digits.

NKOback to summary
public static final NumericShaper.Range NKO

The N'Ko range with the N'Ko digits.

OL_CHIKIback to summary
public static final NumericShaper.Range OL_CHIKI

The Ol Chiki range with the Ol Chiki digits.

ORIYAback to summary
public static final NumericShaper.Range ORIYA

The Oriya range with the Oriya digits.

SAURASHTRAback to summary
public static final NumericShaper.Range SAURASHTRA

The Saurashtra range with the Saurashtra digits.

SINHALAback to summary
public static final NumericShaper.Range SINHALA

The Sinhala range with the Sinhala digits.

Since
9
startback to summary
private final int start
SUNDANESEback to summary
public static final NumericShaper.Range SUNDANESE

The Sundanese range with the Sundanese digits.

TAI_THAM_HORAback to summary
public static final NumericShaper.Range TAI_THAM_HORA

The Tai Tham Hora range with the Tai Tham Hora digits.

TAI_THAM_THAMback to summary
public static final NumericShaper.Range TAI_THAM_THAM

The Tai Tham Tham range with the Tai Tham Tham digits.

TAMILback to summary
public static final NumericShaper.Range TAMIL

The Tamil range with the Tamil digits.

TELUGUback to summary
public static final NumericShaper.Range TELUGU

The Telugu range with the Telugu digits.

THAIback to summary
public static final NumericShaper.Range THAI

The Thai range with the Thai digits.

TIBETANback to summary
public static final NumericShaper.Range TIBETAN

The Tibetan range with the Tibetan digits.

VAIback to summary
public static final NumericShaper.Range VAI

The Vai range with the Vai digits.

Constructor Detail

Rangeback to summary
private Range(int base, int start, int end)

Method Detail

getDigitBaseback to summary
private int getDigitBase()
getNumericBaseback to summary
pack-priv char getNumericBase()
indexToRangeback to summary
private static NumericShaper.Range indexToRange(int index)
inRangeback to summary
private boolean inRange(int c)
maskToRangeSetback to summary
private static Set<NumericShaper.Range> maskToRangeSet(int mask)
toRangeHashback to summary
private static int toRangeHash(Set<NumericShaper.Range> ranges)
toRangeIndexback to summary
private static int toRangeIndex(NumericShaper.Range script)
toRangeMaskback to summary
private static int toRangeMask(Set<NumericShaper.Range> ranges)
valueOfback to summary
public static NumericShaper.Range valueOf(String name)
valuesback to summary
public static NumericShaper.Range[] values()