protected void parseAndAdd(String line){
  StringTokenizer tokenizer=new StringTokenizer(line," ");
  String type=tokenizer.nextToken();
  if (type.equals(STATE) || type.equals(PHONE)) {
    if (tokenizeOnLoad) {
      stateMachine[numStates]=getState(type,tokenizer);
    }
 else {
      stateMachine[numStates]=line;
    }
    numStates++;
  }
 else   if (type.equals(INDEX)) {
    Integer index=new Integer(tokenizer.nextToken());
    if (index.intValue() != numStates) {
      throw new Error("Bad INDEX in file.");
    }
 else {
      String c=tokenizer.nextToken();
      letterIndex.put(c,index);
    }
  }
 else   if (type.equals(TOTAL)) {
    stateMachine=new Object[Integer.parseInt(tokenizer.nextToken())];
  }
}

protected void parseAndAdd ( String line ) { StringTokenizer tokenizer = new StringTokenizer ( line , " " ) ; String type = tokenizer . nextToken ( ) ; if ( type . equals ( STATE ) || type . equals ( PHONE ) ) { if ( tokenizeOnLoad ) { stateMachine [ numStates ] = getState ( type , tokenizer ) ; } else { stateMachine [ numStates ] = line ; } numStates ++ ; } else if ( type . equals ( INDEX ) ) { Integer index = new Integer ( tokenizer . nextToken ( ) ) ; if ( index . intValue ( ) != numStates ) { throw new Error ( "Bad INDEX in file." ) ; } else { String c = tokenizer . nextToken ( ) ; letterIndex . put ( c , index ) ; } } else if ( type . equals ( TOTAL ) ) { stateMachine = new Object [ Integer . parseInt ( tokenizer . nextToken ( ) ) ] ; } }
creates a word from the given input line and add it to the state machine . it expects the total line to come before any of the states .
