|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.text.RBTableBuilder
This class contains all the code to parse a RuleBasedCollator pattern and build a RBCollationTables object from it. A particular instance of tis class exists only during the actual build process-- once an RBCollationTables object has been built, the RBTableBuilder object goes away. This object carries all of the state which is only needed during the build process, plus a "shadow" copy of all of the state that will go into the tables object itself. This object communicates with RBCollationTables through a separate class, RBCollationTables.BuildAPI, this is an inner class of RBCollationTables and provides a separate private API for communication with RBTableBuilder. This class isn't just an inner class of RBCollationTables itself because of its large size. For source-code readability, it seemed better for the builder to have its own source file.
Field Summary | |
(package private) static int |
CHARINDEX
|
private sun.text.IntHashtable |
contractFlags
|
private Vector |
contractTable
|
private Vector |
expandTable
|
private boolean |
frenchSec
|
private static int |
IGNORABLEMASK
|
private static int |
INITIALTABLESIZE
|
private boolean |
isOverIgnore
|
private StringBuffer |
key
|
private sun.text.CompactIntArray |
mapping
|
private static int |
MAXKEYSIZE
|
private short |
maxSecOrder
|
private short |
maxTerOrder
|
private MergeCollation |
mPattern
|
private static int |
PRIMARYORDERINCREMENT
|
private boolean |
seAsianSwapping
|
private static int |
SECONDARYORDERINCREMENT
|
private RBCollationTables.BuildAPI |
tables
|
private static int |
TERTIARYORDERINCREMENT
|
Constructor Summary | |
RBTableBuilder(RBCollationTables.BuildAPI tables)
|
Method Summary | |
private void |
addComposedChars()
Add expanding entries for pre-composed unicode characters so that this collator can be used reasonably well with decomposition turned off. |
private void |
addContractFlags(String chars)
|
private void |
addContractOrder(String groupChars,
int anOrder)
|
private void |
addContractOrder(String groupChars,
int anOrder,
boolean fwd)
Adds the contracting string into the collation table. |
private void |
addExpandOrder(String contractChars,
String expandChars,
int anOrder)
Adds the expanding string into the collation table. |
private int |
addExpansion(int anOrder,
String expandChars)
Create a new entry in the expansion table that contains the orderings for the given characers. |
private void |
addOrder(char ch,
int anOrder)
Adds a character and its designated order into the collation table. |
void |
build(String pattern,
int decmp)
Create a table-based collation object with the given rules. |
private void |
commit()
Look up for unmapped values in the expanded character table. |
private int |
getCharOrder(char ch)
|
private int |
getContractOrder(String groupChars)
If the given string has been specified as a contracting string in this collation table, return its ordering. |
(package private) Vector |
getContractValues(char ch)
Get the entry of hash table of the contracting string in the collation table. |
(package private) Vector |
getContractValues(int index)
|
private int |
increment(int aStrength,
int lastValue)
Increment of the last order based on the comparison level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int CHARINDEX
private static final int IGNORABLEMASK
private static final int PRIMARYORDERINCREMENT
private static final int SECONDARYORDERINCREMENT
private static final int TERTIARYORDERINCREMENT
private static final int INITIALTABLESIZE
private static final int MAXKEYSIZE
private RBCollationTables.BuildAPI tables
private MergeCollation mPattern
private boolean isOverIgnore
private StringBuffer key
private sun.text.IntHashtable contractFlags
private boolean frenchSec
private boolean seAsianSwapping
private sun.text.CompactIntArray mapping
private Vector contractTable
private Vector expandTable
private short maxSecOrder
private short maxTerOrder
Constructor Detail |
public RBTableBuilder(RBCollationTables.BuildAPI tables)
Method Detail |
public void build(String pattern, int decmp) throws ParseException
ParseException
- If the rules format is incorrect.java.util.RuleBasedCollator#RuleBasedCollator
private void addComposedChars() throws ParseException
ParseException
private final void commit()
private final int increment(int aStrength, int lastValue)
private final void addOrder(char ch, int anOrder)
private final void addContractOrder(String groupChars, int anOrder)
private final void addContractOrder(String groupChars, int anOrder, boolean fwd)
private int getContractOrder(String groupChars)
private final int getCharOrder(char ch)
Vector getContractValues(char ch)
ch
- the starting character of the contracting stringVector getContractValues(int index)
private final void addExpandOrder(String contractChars, String expandChars, int anOrder) throws ParseException
ParseException
private int addExpansion(int anOrder, String expandChars)
private void addContractFlags(String chars)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |