public class IntEncodedValueImpl extends Object implements IntEncodedValue
EncodedValue.InitializerConfig| Constructor and Description | 
|---|
IntEncodedValueImpl(String name,
                   int bits,
                   boolean storeTwoDirections)  | 
IntEncodedValueImpl(String name,
                   int bits,
                   int minStorableValue,
                   boolean negateReverseDirection,
                   boolean storeTwoDirections)
This creates an EncodedValue to store an integer value with up to the specified bits. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
getInt(boolean reverse,
      IntsRef ref)
This method restores the integer value from the specified 'flags' taken from the storage. 
 | 
int | 
getMaxOrMaxStorableInt()
Returns the maximum value set using this encoded value or the physical storage limit if no value has been set
 at all yet. 
 | 
int | 
getMaxStorableInt()
The maximum int value this EncodedValue accepts for setInt without throwing an exception. 
 | 
int | 
getMinStorableInt()
The minimum int value this EncodedValue accepts for setInt without throwing an exception. 
 | 
String | 
getName()
This method returns the hierarchical name like vehicle.type of this EncodedValue 
 | 
int | 
init(EncodedValue.InitializerConfig init)
This method sets the dataIndex and shift of this EncodedValue object and potentially changes the submitted init
 object afterwards via calling next 
 | 
boolean | 
isStoreTwoDirections()  | 
void | 
setInt(boolean reverse,
      IntsRef ref,
      int value)
This method stores the specified integer value in the specified IntsRef. 
 | 
String | 
toString()  | 
public IntEncodedValueImpl(String name, int bits, boolean storeTwoDirections)
public IntEncodedValueImpl(String name, int bits, int minStorableValue, boolean negateReverseDirection, boolean storeTwoDirections)
name - the key to identify this EncodedValuebits - the bits that should be reserved for storing the value. This determines the
                               maximum value.minStorableValue - the minimum value. Use e.g. 0 if no negative values are needed.negateReverseDirection - true if the reverse direction should be always negative of the forward direction.
                               This is used to reduce space and store the value only once. If this option is used
                               you cannot use storeTwoDirections or a minValue different to 0.storeTwoDirections - true if forward and backward direction of the edge should get two independent values.public final int init(EncodedValue.InitializerConfig init)
EncodedValueinit in interface EncodedValueEncodedValue.InitializerConfig.next(int)public final void setInt(boolean reverse,
                         IntsRef ref,
                         int value)
IntEncodedValuesetInt in interface IntEncodedValuepublic final int getInt(boolean reverse,
                        IntsRef ref)
IntEncodedValuegetInt in interface IntEncodedValuepublic int getMaxStorableInt()
IntEncodedValuegetMaxStorableInt in interface IntEncodedValuepublic int getMinStorableInt()
IntEncodedValuegetMinStorableInt in interface IntEncodedValuepublic int getMaxOrMaxStorableInt()
IntEncodedValuegetMaxOrMaxStorableInt in interface IntEncodedValuepublic final boolean isStoreTwoDirections()
isStoreTwoDirections in interface EncodedValueisStoreTwoDirections in interface IntEncodedValuepublic final String getName()
EncodedValuegetName in interface EncodedValueCopyright © 2012–2022. All rights reserved.