Interface LongPairRangeSet<T extends java.lang.Comparable<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addOpenClosed​(long lowerKey, long lowerValue, long upperKey, long upperValue)
      Adds the specified range (range that contains all values strictly greater than lower and less than or equal to upper.) to this RangeSet (optional operation).
      java.util.Collection<com.google.common.collect.Range<T>> asRanges()
      Returns a view of the disconnected ranges that make up this range set.
      int cardinality​(long lowerKey, long lowerValue, long upperKey, long upperValue)
      Return the number bit sets to true from lower (inclusive) to upper (inclusive).
      void clear()  
      boolean contains​(long key, long value)
      Determines whether any of this range set's member ranges contains value.
      com.google.common.collect.Range<T> firstRange()
      It returns very first smallest range in the rangeSet.
      void forEach​(LongPairRangeSet.RangeProcessor<T> action)
      Performs the given action for each entry in this map until all entries have been processed or action returns "false".
      void forEach​(LongPairRangeSet.RangeProcessor<T> action, LongPairRangeSet.LongPairConsumer<? extends T> consumer)
      Performs the given action for each entry in this map until all entries have been processed or action returns "false".
      boolean isEmpty()  
      com.google.common.collect.Range<T> lastRange()
      It returns very last biggest range in the rangeSet.
      com.google.common.collect.Range<T> rangeContaining​(long key, long value)
      Returns the unique range from this range set that contains value, or null if this range set does not contain value.
      void removeAtMost​(long key, long value)
      Remove range that contains all values less than or equal to given key-value.
      int size()
      Returns total number of ranges into the set.
      com.google.common.collect.Range<T> span()
      Returns the minimal range which encloses all ranges in this range set.
    • Method Detail

      • addOpenClosed

        void addOpenClosed​(long lowerKey,
                           long lowerValue,
                           long upperKey,
                           long upperValue)
        Adds the specified range (range that contains all values strictly greater than lower and less than or equal to upper.) to this RangeSet (optional operation). That is, for equal range sets a and b, the result of a.add(range) is that a will be the minimal range set for which both a.enclosesAll(b) and a.encloses(range).
        
         @param lowerKey :  value for key of lowerEndpoint of Range
         @param lowerValue: value for value of lowerEndpoint of Range
         @param upperKey  : value for key of upperEndpoint of Range
         @param upperValue: value for value of upperEndpoint of Range
         
      • contains

        boolean contains​(long key,
                         long value)
        Determines whether any of this range set's member ranges contains value.
      • rangeContaining

        com.google.common.collect.Range<T> rangeContaining​(long key,
                                                           long value)
        Returns the unique range from this range set that contains value, or null if this range set does not contain value.
      • removeAtMost

        void removeAtMost​(long key,
                          long value)
        Remove range that contains all values less than or equal to given key-value.
        Parameters:
        key -
        value -
      • isEmpty

        boolean isEmpty()
      • clear

        void clear()
      • span

        com.google.common.collect.Range<T> span()
        Returns the minimal range which encloses all ranges in this range set.
        Returns:
      • asRanges

        java.util.Collection<com.google.common.collect.Range<T>> asRanges()
        Returns a view of the disconnected ranges that make up this range set.
        Returns:
      • forEach

        void forEach​(LongPairRangeSet.RangeProcessor<T> action)
        Performs the given action for each entry in this map until all entries have been processed or action returns "false". Unless otherwise specified by the implementing class, actions are performed in the order of entry set iteration (if an iteration order is specified.)
        Parameters:
        action -
      • forEach

        void forEach​(LongPairRangeSet.RangeProcessor<T> action,
                     LongPairRangeSet.LongPairConsumer<? extends T> consumer)
        Performs the given action for each entry in this map until all entries have been processed or action returns "false". Unless otherwise specified by the implementing class, actions are performed in the order of entry set iteration (if an iteration order is specified.)
        Parameters:
        action -
        consumer -
      • size

        int size()
        Returns total number of ranges into the set.
        Returns:
      • firstRange

        com.google.common.collect.Range<T> firstRange()
        It returns very first smallest range in the rangeSet.
        Returns:
        first smallest range into the set
      • lastRange

        com.google.common.collect.Range<T> lastRange()
        It returns very last biggest range in the rangeSet.
        Returns:
        last biggest range into the set
      • cardinality

        int cardinality​(long lowerKey,
                        long lowerValue,
                        long upperKey,
                        long upperValue)
        Return the number bit sets to true from lower (inclusive) to upper (inclusive).