Class HashRange

  • All Implemented Interfaces:
    java.io.Serializable, KeyRange<java.lang.Integer>

    public final class HashRange
    extends java.lang.Object
    implements KeyRange<java.lang.Integer>
    Descriptor for hash range.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HashRange all()  
      boolean equals​(java.lang.Object o)
      This method should be overridden for KeyRange comparisons.
      int hashCode()
      This method should be overridden for KeyRange comparisons.
      boolean includes​(java.lang.Integer i)  
      boolean isAll()  
      static HashRange of​(int rangeStartInclusive, int rangeEndExclusive)  
      java.lang.Integer rangeBeginInclusive()  
      java.lang.Integer rangeEndExclusive()  
      java.lang.String toString()
      This method should be overridden for a readable representation of KeyRange.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • all

        public static HashRange all()
        Returns:
        Gets a hash range descriptor representing the whole data from a partition.
      • of

        public static HashRange of​(int rangeStartInclusive,
                                   int rangeEndExclusive)
        Parameters:
        rangeStartInclusive - the start of the range (inclusive)
        rangeEndExclusive - the end of the range (exclusive)
        Returns:
        A hash range descriptor representing [rangeBeginInclusive, rangeEndExclusive)
      • isAll

        public boolean isAll()
        Specified by:
        isAll in interface KeyRange<java.lang.Integer>
        Returns:
        whether this hash range descriptor represents the whole data or not.
      • rangeBeginInclusive

        public java.lang.Integer rangeBeginInclusive()
        Specified by:
        rangeBeginInclusive in interface KeyRange<java.lang.Integer>
        Returns:
        the beginning of this range (inclusive).
      • rangeEndExclusive

        public java.lang.Integer rangeEndExclusive()
        Specified by:
        rangeEndExclusive in interface KeyRange<java.lang.Integer>
        Returns:
        the end of the range (exclusive)
      • includes

        public boolean includes​(java.lang.Integer i)
        Specified by:
        includes in interface KeyRange<java.lang.Integer>
        Parameters:
        i - the value to test
        Returns:
        true if this hash range includes the specified value, false otherwise
      • toString

        public java.lang.String toString()
        This method should be overridden for a readable representation of KeyRange. The generic type K should override Object's toString() as well. This method should be overridden for a readable representation of KeyRange. The generic type K should override Object's toString() as well.
        Specified by:
        toString in interface KeyRange<java.lang.Integer>
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from interface: KeyRange
        This method should be overridden for KeyRange comparisons.
        Specified by:
        equals in interface KeyRange<java.lang.Integer>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Description copied from interface: KeyRange
        This method should be overridden for KeyRange comparisons.
        Specified by:
        hashCode in interface KeyRange<java.lang.Integer>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash value.