Class KeyRange


  • public class KeyRange
    extends java.lang.Object
    Class for holding a range of database keys (long values)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      long maxKey  
      long minKey  
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyRange​(long minKey, long maxKey)
      Constructs a new key range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(long key)
      Tests if the given key is in the range.
      long length()
      Return the number of keys contained within range.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • minKey

        public long minKey
      • maxKey

        public long maxKey
    • Constructor Detail

      • KeyRange

        public KeyRange​(long minKey,
                        long maxKey)
        Constructs a new key range. Keys must be ordered and unsigned.
        Parameters:
        minKey - the min key (inclusive)
        maxKey - the max key (inclusive)
    • Method Detail

      • contains

        public boolean contains​(long key)
        Tests if the given key is in the range.
        Parameters:
        key - the key to test
        Returns:
        true if the key is in the range, false otherwise
      • length

        public long length()
        Return the number of keys contained within range.
        Returns:
        number of keys contained within range