/** * put the object into the char map using the char as the key */ Object put(char key, Object value) { if (itemsKeys == null) { itemsKeys = new char[1]; itemsKeys[0] = key; itemsObjs = new Object[1]; itemsObjs[0] = value; return value; }// if first time int index = Arrays.binarySearch(itemsKeys, key); if (index<0) { index = ~index; resize(index); itemsKeys[index] = key; itemsObjs[index] = value; } return itemsObjs[index]; } // put
/** This method is used to access the transition function of this state. */ // >>> DAM: was /* FSMState next(Character chr) {//UnicodeType type){ return (FSMState)transitionFunction.get(chr); } */ // >>> DAM: TransArray optimization public FSMState next(char chr) {//UnicodeType type){ return (FSMState)transitionFunction.get(chr); } // >>> DAM: end
/** Adds a new value to the transition function */ // >>> DAM: was - to use CharMap /* void put(Character chr, FSMState state) { transitionFunction.put(chr,state); } */ // >>> DAM: TransArray optimization public void put(char chr, FSMState state) { transitionFunction.put(chr,state); } // >>> DAM: end