Top Description Inners Fields Constructors Methods
com.ibm.icu.impl

public Class StaticUnicodeSets

extends Object
Class Inheritance
Imports
java.util.EnumMap, .Map, com.ibm.icu.impl.UResource.Value, com.ibm.icu.text.UnicodeSet, com.ibm.icu.util.ULocale, .UResourceBundle

This class statically initializes UnicodeSets, originally built for number parsing. Microbenchmarks show this to bring a very sizeable performance boost. IMPORTANT ASSUMPTION FOR NUMBER PARSING: All of the sets contain code points (no strings) and they are all case-folded. If this assumption were ever broken, logic in classes such as SymbolMatcher would need to be updated in order to return well-formed sets upon calls to getLeadCodePoints().
Author
sffc

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Map<StaticUnicodeSets.Key, UnicodeSet>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static StaticUnicodeSets.Key
chooseCurrency(String str)

Looks through all Currency-related sets for the given string, returning the first match or null if no match was round.

public static StaticUnicodeSets.Key

Returns:

key1 if the set contains str, or COUNT if not.
chooseFrom
(String
The string to check.
str
,
StaticUnicodeSets.Key
The set to check.
key1
)

Checks if the UnicodeSet given by key1 contains the given string.

public static StaticUnicodeSets.Key

Returns:

key1 if that set contains str; key2 if that set contains str; or COUNT if neither set contains str.
chooseFrom
(String
The string to check.
str
,
StaticUnicodeSets.Key
The first set to check.
key1
,
StaticUnicodeSets.Key
The second set to check.
key2
)

Checks if the UnicodeSet given by either key1 or key2 contains the string.

private static UnicodeSet
private static UnicodeSet
public static UnicodeSet

Returns:

The requested UnicodeSet. Guaranteed to be frozen and non-null, but may be empty if an error occurred during data loading.
get
(StaticUnicodeSets.Key
The desired UnicodeSet according to the enum in this file.
key
)

Gets the static-allocated UnicodeSet according to the provided key.

private static void
saveSet(StaticUnicodeSets.Key key, String unicodeSetPattern)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

unicodeSetsback to summary
private static final Map<StaticUnicodeSets.Key, UnicodeSet> unicodeSets

Constructor Detail

StaticUnicodeSetsback to summary
public StaticUnicodeSets()

Method Detail

chooseCurrencyback to summary
public static StaticUnicodeSets.Key chooseCurrency(String str)

Looks through all Currency-related sets for the given string, returning the first match or null if no match was round.

chooseFromback to summary
public static StaticUnicodeSets.Key chooseFrom(String str, StaticUnicodeSets.Key key1)

Checks if the UnicodeSet given by key1 contains the given string.

Parameters
str:String

The string to check.

key1:StaticUnicodeSets.Key

The set to check.

Returns:StaticUnicodeSets.Key

key1 if the set contains str, or COUNT if not.

chooseFromback to summary
public static StaticUnicodeSets.Key chooseFrom(String str, StaticUnicodeSets.Key key1, StaticUnicodeSets.Key key2)

Checks if the UnicodeSet given by either key1 or key2 contains the string. Exported as U_COMMON_API for numparse_decimal.cpp

Parameters
str:String

The string to check.

key1:StaticUnicodeSets.Key

The first set to check.

key2:StaticUnicodeSets.Key

The second set to check.

Returns:StaticUnicodeSets.Key

key1 if that set contains str; key2 if that set contains str; or COUNT if neither set contains str.

computeUnionback to summary
private static UnicodeSet computeUnion(StaticUnicodeSets.Key k1, StaticUnicodeSets.Key k2)
computeUnionback to summary
private static UnicodeSet computeUnion(StaticUnicodeSets.Key k1, StaticUnicodeSets.Key k2, StaticUnicodeSets.Key k3)
getback to summary
public static UnicodeSet get(StaticUnicodeSets.Key key)

Gets the static-allocated UnicodeSet according to the provided key.

Parameters
key:StaticUnicodeSets.Key

The desired UnicodeSet according to the enum in this file.

Returns:UnicodeSet

The requested UnicodeSet. Guaranteed to be frozen and non-null, but may be empty if an error occurred during data loading.

saveSetback to summary
private static void saveSet(StaticUnicodeSets.Key key, String unicodeSetPattern)
com.ibm.icu.impl back to summary

public final Enum StaticUnicodeSets.Key

extends Enum<StaticUnicodeSets.Key>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key
public static final StaticUnicodeSets.Key

Constructor Summary

AccessConstructor and Description
private
Key()

Method Summary

Modifier and TypeMethod and Description
public static StaticUnicodeSets.Key
public static StaticUnicodeSets.Key[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALL_SEPARATORSback to summary
public static final StaticUnicodeSets.Key ALL_SEPARATORS
APOSTROPHE_SIGNback to summary
public static final StaticUnicodeSets.Key APOSTROPHE_SIGN
COMMAback to summary
public static final StaticUnicodeSets.Key COMMA
DEFAULT_IGNORABLESback to summary
public static final StaticUnicodeSets.Key DEFAULT_IGNORABLES
DIGITSback to summary
public static final StaticUnicodeSets.Key DIGITS
DIGITS_OR_ALL_SEPARATORSback to summary
public static final StaticUnicodeSets.Key DIGITS_OR_ALL_SEPARATORS
DIGITS_OR_STRICT_ALL_SEPARATORSback to summary
public static final StaticUnicodeSets.Key DIGITS_OR_STRICT_ALL_SEPARATORS
DOLLAR_SIGNback to summary
public static final StaticUnicodeSets.Key DOLLAR_SIGN
EMPTYback to summary
public static final StaticUnicodeSets.Key EMPTY
INFINITY_SIGNback to summary
public static final StaticUnicodeSets.Key INFINITY_SIGN
MINUS_SIGNback to summary
public static final StaticUnicodeSets.Key MINUS_SIGN
OTHER_GROUPING_SEPARATORSback to summary
public static final StaticUnicodeSets.Key OTHER_GROUPING_SEPARATORS
PERCENT_SIGNback to summary
public static final StaticUnicodeSets.Key PERCENT_SIGN
PERIODback to summary
public static final StaticUnicodeSets.Key PERIOD
PERMILLE_SIGNback to summary
public static final StaticUnicodeSets.Key PERMILLE_SIGN
PLUS_SIGNback to summary
public static final StaticUnicodeSets.Key PLUS_SIGN
POUND_SIGNback to summary
public static final StaticUnicodeSets.Key POUND_SIGN
RUPEE_SIGNback to summary
public static final StaticUnicodeSets.Key RUPEE_SIGN
STRICT_ALL_SEPARATORSback to summary
public static final StaticUnicodeSets.Key STRICT_ALL_SEPARATORS
STRICT_COMMAback to summary
public static final StaticUnicodeSets.Key STRICT_COMMA
STRICT_IGNORABLESback to summary
public static final StaticUnicodeSets.Key STRICT_IGNORABLES
STRICT_PERIODback to summary
public static final StaticUnicodeSets.Key STRICT_PERIOD
WON_SIGNback to summary
public static final StaticUnicodeSets.Key WON_SIGN
YEN_SIGNback to summary
public static final StaticUnicodeSets.Key YEN_SIGN

Constructor Detail

Keyback to summary
private Key()

Method Detail

valueOfback to summary
public static StaticUnicodeSets.Key valueOf(String name)
valuesback to summary
public static StaticUnicodeSets.Key[] values()
com.ibm.icu.impl back to summary

pack-priv Class StaticUnicodeSets.ParseDataSink

extends Sink
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
put(UResource.Key
Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.
key
,
UResource.Value
Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.
value
,
boolean
true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.
noFallback
)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root).

Constructor Detail

ParseDataSinkback to summary
pack-priv ParseDataSink()

Method Detail

putback to summary
public void put(UResource.Key key, UResource.Value value, boolean noFallback)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Doc from com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.

Parameters
key:UResource.Key

Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.

value:UResource.Value

Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.

noFallback:boolean

true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.

Annotations
@Override