Class GHLongLongBTree

java.lang.Object
com.graphhopper.coll.GHLongLongBTree
All Implemented Interfaces:
LongLongMap

public class GHLongLongBTree extends Object implements 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 interface LongLongMap
    • get

      public long get(long key)
      Specified by:
      get in interface LongLongMap
    • getSize

      public long getSize()
      Specified by:
      getSize in interface LongLongMap
    • getMemoryUsage

      public int getMemoryUsage()
      Specified by:
      getMemoryUsage in interface LongLongMap
      Returns:
      memory usage in MB
    • clear

      public void clear()
      Specified by:
      clear in interface LongLongMap
    • getEmptyValue

      public long getEmptyValue()
    • optimize

      public void optimize()
      Specified by:
      optimize in interface LongLongMap
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMaxValue

      public long getMaxValue()
      Specified by:
      getMaxValue in interface LongLongMap