Package com.graphhopper.coll
Class GHLongLongBTree
java.lang.Object
com.graphhopper.coll.GHLongLongBTree
- All Implemented Interfaces:
LongLongMap
An in-memory B-Tree with configurable value size (1-8 bytes). Delete not supported.
(Later we could use DataAccess to allow on-disc storage for very large data sets.)
- Author:
- Peter Karich
-
Constructor Details
-
GHLongLongBTree
public GHLongLongBTree(int maxLeafEntries, int bytesPerValue, long emptyValue)
-
-
Method Details
-
put
public long put(long key, long value) - Specified by:
put
in interfaceLongLongMap
-
get
public long get(long key) - Specified by:
get
in interfaceLongLongMap
-
getSize
public long getSize()- Specified by:
getSize
in interfaceLongLongMap
-
getMemoryUsage
public int getMemoryUsage()- Specified by:
getMemoryUsage
in interfaceLongLongMap
- Returns:
- memory usage in MB
-
clear
public void clear()- Specified by:
clear
in interfaceLongLongMap
-
getEmptyValue
public long getEmptyValue() -
optimize
public void optimize()- Specified by:
optimize
in interfaceLongLongMap
-
toString
-
getMaxValue
public long getMaxValue()- Specified by:
getMaxValue
in interfaceLongLongMap
-