Added get/setState() to ReplayingDecoder

This commit is contained in:
Trustin Lee 2008-12-01 09:41:46 +00:00
parent 5bed9f4bc4
commit e8b1a2862e

View File

@ -247,6 +247,24 @@ public abstract class ReplayingDecoder<T extends Enum<T>> extends SimpleChannelH
checkpoint = cumulation.readerIndex();
}
/**
* Returns the current state of this decoder.
* @return the current state of this decoder
*/
protected T getState() {
return state;
}
/**
* Sets the current state of this decoder.
* @return the old state of this decoder
*/
protected T setState(T newState) {
T oldState = state;
state = newState;
return oldState;
}
/**
* Decodes the received packets so far into a frame.
*