public class EncodedValue extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
defaultValue |
protected double |
factor |
protected long |
mask |
protected long |
shift |
Constructor and Description |
---|
EncodedValue(String name,
int shift,
int bits,
double factor,
long defaultValue,
int maxValue)
Define a bit-encoded value
|
EncodedValue(String name,
int shift,
int bits,
double factor,
long defaultValue,
int maxValue,
boolean allowZero) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkValue(long value) |
int |
getBits() |
double |
getFactor() |
long |
getMaxValue() |
String |
getName() |
long |
getValue(long flags) |
long |
setDefaultValue(long flags) |
long |
setValue(long flags,
long value) |
long |
swap(long flags,
EncodedValue otherEncoder)
Swap the contents controlled by this value encoder with the given value.
|
protected final long shift
protected final long mask
protected final double factor
protected final long defaultValue
public EncodedValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue)
name
- Description for debuggingshift
- bit index of this valuebits
- number of bits reservedfactor
- scaling factor for stored valuesdefaultValue
- default valuemaxValue
- default maximum valuepublic EncodedValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero)
protected void checkValue(long value)
public long setValue(long flags, long value)
public String getName()
public long getValue(long flags)
public int getBits()
public double getFactor()
public long setDefaultValue(long flags)
public long getMaxValue()
public long swap(long flags, EncodedValue otherEncoder)
Copyright © 2012–2017. All rights reserved.