public final class UnsignedDecimalEncodedValue extends UnsignedIntEncodedValue implements DecimalEncodedValue
EncodedValue.InitializerConfig
Modifier and Type | Field and Description |
---|---|
protected double |
factor |
bwdDataIndex, fwdDataIndex
Constructor and Description |
---|
UnsignedDecimalEncodedValue(String name,
int bits,
double factor,
boolean storeTwoDirections) |
UnsignedDecimalEncodedValue(String name,
int bits,
double factor,
double defaultValue,
boolean storeTwoDirections) |
UnsignedDecimalEncodedValue(String name,
int bits,
double factor,
double defaultValue,
boolean storeTwoDirections,
boolean useMaximumAsInfinity) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
double |
getDecimal(boolean reverse,
IntsRef ref) |
double |
getMaxDecimal()
The double value this EncodedValue accepts for setDecimal without throwing an exception.
|
int |
getVersion()
The return value represents the state of this EncodedValue and it can be assumed that two JVMs return the
same version when the EncodedValue has the same state unlike the hashCode method.
|
void |
setDecimal(boolean reverse,
IntsRef ints,
double value)
This method stores the specified double value (rounding with a previously defined factor) into the IntsRef.
|
getInt, getMaxInt, getName, hashCode, init, isStoreTwoDirections, setInt, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isStoreTwoDirections
getName, init
public UnsignedDecimalEncodedValue(String name, int bits, double factor, boolean storeTwoDirections)
public UnsignedDecimalEncodedValue(String name, int bits, double factor, double defaultValue, boolean storeTwoDirections)
name
- the key to identify this EncodedValuebits
- the bits that should be reserved for the storagefactor
- the precision factor, i.e. store = (int) Math.round(value / factor)defaultValue
- the value that should be returned if the stored value is 0.storeTwoDirections
- true if forward and backward direction of the edge should get two independent values.public UnsignedDecimalEncodedValue(String name, int bits, double factor, double defaultValue, boolean storeTwoDirections, boolean useMaximumAsInfinity)
public final void setDecimal(boolean reverse, IntsRef ints, double value)
DecimalEncodedValue
setDecimal
in interface DecimalEncodedValue
DecimalEncodedValue.getMaxDecimal()
public final double getDecimal(boolean reverse, IntsRef ref)
getDecimal
in interface DecimalEncodedValue
public double getMaxDecimal()
DecimalEncodedValue
getMaxDecimal
in interface DecimalEncodedValue
public boolean equals(Object o)
equals
in class UnsignedIntEncodedValue
public int getVersion()
EncodedValue
getVersion
in interface EncodedValue
getVersion
in class UnsignedIntEncodedValue
Copyright © 2012–2020. All rights reserved.