java.text
Class DictionaryBasedBreakIterator.Builder

java.lang.Object
  extended byjava.text.RuleBasedBreakIterator.Builder
      extended byjava.text.DictionaryBasedBreakIterator.Builder
Enclosing class:
DictionaryBasedBreakIterator

protected class DictionaryBasedBreakIterator.Builder
extends RuleBasedBreakIterator.Builder

The Builder class for DictionaryBasedBreakIterator inherits almost all of its functionality from the Builder class for RuleBasedBreakIterator, but extends it with extra logic to handle the "" token


Field Summary
private  CharSet dictionaryChars
          A CharSet that contains all the characters represented in the dictionary
private  String dictionaryExpression
           
 
Fields inherited from class java.text.RuleBasedBreakIterator.Builder
ALL_FLAGS, categories, clearLoopingStates, decisionPointList, decisionPointStack, DONT_LOOP_FLAG, END_STATE_FLAG, expressions, ignoreChars, LOOKAHEAD_STATE_FLAG, loopingStates, mergeList, statesToBackfill, tempStateTable
 
Constructor Summary
DictionaryBasedBreakIterator.Builder()
          No special initialization
 
Method Summary
protected  void buildCharCategories(Vector tempRuleList)
          The other half of the logic to handle the dictionary characters happens here.
protected  void handleSpecialSubstitution(String replace, String replaceWith, int startPos, String description)
          We override handleSpecialSubstitution() to add logic to handle the tag.
protected  void mungeExpressionList(Hashtable expressions)
           
 
Methods inherited from class java.text.RuleBasedBreakIterator.Builder
buildBreakIterator, error, processSubstitution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dictionaryChars

private CharSet dictionaryChars
A CharSet that contains all the characters represented in the dictionary


dictionaryExpression

private String dictionaryExpression
Constructor Detail

DictionaryBasedBreakIterator.Builder

public DictionaryBasedBreakIterator.Builder()
No special initialization

Method Detail

handleSpecialSubstitution

protected void handleSpecialSubstitution(String replace,
                                         String replaceWith,
                                         int startPos,
                                         String description)
We override handleSpecialSubstitution() to add logic to handle the tag. If we see a substitution named "", parse the substitution expression and store the result in dictionaryChars.

Overrides:
handleSpecialSubstitution in class RuleBasedBreakIterator.Builder

buildCharCategories

protected void buildCharCategories(Vector tempRuleList)
The other half of the logic to handle the dictionary characters happens here. After the inherited builder has derived the real character categories, we set up the categoryFlags array in the iterator. This array contains "true" for every character category that includes a dictionary character.

Overrides:
buildCharCategories in class RuleBasedBreakIterator.Builder

mungeExpressionList

protected void mungeExpressionList(Hashtable expressions)
Overrides:
mungeExpressionList in class RuleBasedBreakIterator.Builder