|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.text.RuleBasedBreakIterator_Old.Builder
The Builder class has the job of constructing a RuleBasedBreakIterator_Old from a textual description. A Builder is constructed by RuleBasedBreakIterator_Old's constructor, which uses it to construct the iterator itself and then throws it away.
The construction logic is separated out into its own class for two primary reasons:
It'd be really nice if this could be an independent class rather than an inner class, because that would shorten the source file considerably, but making Builder an inner class of RuleBasedBreakIterator_Old allows it direct access to RuleBasedBreakIterator_Old's private members, which saves us from having to provide some kind of "back door" to the Builder class that could then also be used by other classes.
Field Summary | |
protected static int |
ALL_FLAGS
A bit mask representing the union of the mask values listed above. |
protected java.util.Vector |
categories
A temporary holding place used for calculating the character categories. |
protected boolean |
clearLoopingStates
A flag that is used to indicate when the list of looping states can be reset. |
protected java.util.Vector |
decisionPointList
A list of all the states that have to be filled in with transitions to the next state that is created. |
protected java.util.Stack |
decisionPointStack
A stack for holding decision point lists. |
protected static int |
DONT_LOOP_FLAG
A bit mask used to indicate a bit in the table's flags column that marks a state as one the builder shouldn't loop to any looping states |
protected static int |
END_STATE_FLAG
A bit mask used to indicate a bit in the table's flags column that marks a state as an accepting state. |
protected java.util.Hashtable |
expressions
A table used to map parts of regexp text to lists of character categories, rather than having to figure them out from scratch each time |
protected UnicodeSet |
ignoreChars
A temporary holding place for the list of ignore characters |
protected static int |
LOOKAHEAD_STATE_FLAG
A bit mask used to indicate a bit in the table's flags column that marks a state as a lookahead state. |
protected java.util.Vector |
loopingStates
A list of states that loop back on themselves. |
protected java.util.Vector |
mergeList
A list mapping pairs of state numbers for states that are to be combined to the state number of the state representing their combination. |
protected java.util.Vector |
statesToBackfill
Looping states actually have to be backfilled later in the process than everything else. |
protected java.util.Vector |
tempStateTable
A temporary holding place where the forward state table is built |
Constructor Summary | |
RuleBasedBreakIterator_Old.Builder()
No special construction is required for the Builder. |
Method Summary | |
void |
buildBreakIterator()
This is the main function for setting up the BreakIterator's tables. |
protected void |
buildCharCategories(java.util.Vector tempRuleList)
This function builds the character category table. |
protected void |
debugPrintTempStateTable()
|
protected void |
debugPrintVector(java.lang.String label,
java.util.Vector v)
|
protected void |
debugPrintVectorOfVectors(java.lang.String label1,
java.lang.String label2,
java.util.Vector v)
|
protected void |
error(java.lang.String message,
int position,
java.lang.String context)
Throws an IllegalArgumentException representing a syntax error in the rule description. |
protected void |
handleSpecialSubstitution(java.lang.String replace,
java.lang.String replaceWith,
int startPos,
java.lang.String description)
This function defines a protocol for handling substitution names that are "special," i.e., that have some property beyond just being substitutions. |
protected void |
mungeExpressionList(java.util.Hashtable expressions)
|
protected java.lang.String |
processSubstitution(java.lang.String substitutionRule,
java.lang.String description,
int startPos)
This function performs variable-name substitutions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector categories
protected java.util.Hashtable expressions
protected UnicodeSet ignoreChars
protected java.util.Vector tempStateTable
protected java.util.Vector decisionPointList
protected java.util.Stack decisionPointStack
protected java.util.Vector loopingStates
protected java.util.Vector statesToBackfill
protected java.util.Vector mergeList
protected boolean clearLoopingStates
protected static final int END_STATE_FLAG
protected static final int DONT_LOOP_FLAG
protected static final int LOOKAHEAD_STATE_FLAG
protected static final int ALL_FLAGS
Constructor Detail |
public RuleBasedBreakIterator_Old.Builder()
Method Detail |
public void buildBreakIterator()
protected java.lang.String processSubstitution(java.lang.String substitutionRule, java.lang.String description, int startPos)
protected void handleSpecialSubstitution(java.lang.String replace, java.lang.String replaceWith, int startPos, java.lang.String description)
protected void buildCharCategories(java.util.Vector tempRuleList)
protected void mungeExpressionList(java.util.Hashtable expressions)
protected void error(java.lang.String message, int position, java.lang.String context)
message
- A message describing the problemposition
- The position in the description where the problem was
discoveredcontext
- The string containing the errorprotected void debugPrintVector(java.lang.String label, java.util.Vector v)
protected void debugPrintVectorOfVectors(java.lang.String label1, java.lang.String label2, java.util.Vector v)
protected void debugPrintTempStateTable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |