step.encoding
Class StrideIntStrategy
java.lang.Object
|
+--step.encoding.Encoder
|
+--step.encoding.Strategy
|
+--step.encoding.RegularValueStrategy
|
+--step.encoding.StrideIntStrategy
- Direct Known Subclasses:
- PStrideIntStrategy
- public class StrideIntStrategy
- extends RegularValueStrategy
Assume that the (integer) values increase or decrease with a regular
increment.
Algorithm:
if current - last == stride
then -> nothing
else -> meta:IrregularValueEvent
, current
Credit: Chilimbi, Jones, Zorn (HATF/Meta-TF)
- See Also:
StepInt
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STRATEGY_NAME
public static final String STRATEGY_NAME
- See Also:
- Constant Field Values
StrideIntStrategy
public StrideIntStrategy(Encoder baseEncoder,
int stride)
- Create a new "stride" strategy.
- Parameters:
baseEncoder
- the encoder to defer to for deviant values.stride
- the increment from the previous value.
encode
public void encode(StepObject o,
EncodeContext context)
throws EncoderException,
IOException
- Encode a stride value.
- Specified by:
encode
in class Encoder
- Throws:
EncoderException
- if the value is not a StepInt
.
IOException
- if the encode operation encountered an I/O failure.
decode
public StepObject decode(DecodeContext context)
throws EncoderException,
IOException
- Decode a stride value.
- Specified by:
decode
in class Encoder
- Throws:
IOException
- if the decode operation encountered an I/O failure.
EncoderException
- if the decode operation encountered an error.
dump
public void dump(int level)
- Specified by:
dump
in class Encoder