@Override
public void replace(int mapIndex, char key, int newState, int oldState) {
char[] entries = storeKeysAndStates.get(mapIndex);
int index = binarySearchInEntries(entries, key);
if(index<0) {
throw new GateRuntimeException("CharMapState: should have key but not found: "+key);
}
if(entries[index] != oldState) {
throw new GateRuntimeException("CharMapState: old states differ!");
}
char[] c2 = Utils.int2TwoChars(newState);
entries[index+1] = c2[0];
entries[index+2] = c2[1];
}