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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStoreTwoDirectionsgetName, initpublic 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)
DecimalEncodedValuesetDecimal in interface DecimalEncodedValueDecimalEncodedValue.getMaxDecimal()public final double getDecimal(boolean reverse,
                               IntsRef ref)
getDecimal in interface DecimalEncodedValuepublic double getMaxDecimal()
DecimalEncodedValuegetMaxDecimal in interface DecimalEncodedValuepublic boolean equals(Object o)
equals in class UnsignedIntEncodedValuepublic int getVersion()
EncodedValuegetVersion in interface EncodedValuegetVersion in class UnsignedIntEncodedValueCopyright © 2012–2020. All rights reserved.