Class CritBit64<V>

    • Constructor Detail

      • CritBit64

        protected CritBit64()
    • Method Detail

      • create

        public static <V> CritBit64<V> create()
        Create a 1D crit-bit tree with 64 bit key length.
        Type Parameters:
        V - value type
        Returns:
        a 1D crit-bit tree
      • put

        public V put​(long key,
                     V val)
        Add a key value pair to the tree or replace the value if the key already exists.
        Parameters:
        key - key
        val - value
        Returns:
        The previous value or null if there was no previous value
      • printTree

        public void printTree()
      • checkTree

        public boolean checkTree()
      • size

        public int size()
        Get the size of the tree.
        Returns:
        the number of keys in the tree
      • contains

        public boolean contains​(long key)
        Check whether a given key exists in the tree.
        Parameters:
        key - key
        Returns:
        true if the key exists otherwise false
      • get

        public V get​(long key)
        Get the value for a given key.
        Parameters:
        key - key
        Returns:
        the values associated with key or null if the key does not exist.
      • remove

        public V remove​(long key)
        Remove a key and its value
        Parameters:
        key - key
        Returns:
        The value of the key of null if the value was not found.
      • query

        public CritBit64.QueryIterator<V> query​(long min,
                                                long max)
        Queries the tree for entries with min<=key<=max.
        Parameters:
        min - minimum key
        max - maximum key
        Returns:
        An iterator over the matching entries.
      • queryWithMask

        public CritBit64.QueryIteratorMask<V> queryWithMask​(long min,
                                                            long max)
        Queries the tree for entries with min<=key<=max. Unlike the normal query, this query also excludes all elements with (key|min)!=key and (key&max!=max). See PH-Tree for a discussion.
        Parameters:
        min - minimum key
        max - maximum key
        Returns:
        An iterator over the matching entries.