接口 LongPairRangeSet<T extends Comparable<T>>

所有已知实现类:
ConcurrentOpenLongPairRangeSet, LongPairRangeSet.DefaultRangeSet

public interface LongPairRangeSet<T extends Comparable<T>>
A set comprising zero or more ranges type of key-value pair.
  • 嵌套类概要

    嵌套类
    修饰符和类型
    接口
    说明
    static class 
    Generic implementation of a default range set.
    static class 
    This class is a simple key-value data structure.
    static interface 
    Represents a function that accepts two long arguments and produces a result.
    static interface 
    Represents a function that accepts result and produces a LongPair.
    static interface 
    The interface exposing a method for processing of ranges.
    static interface 
    The interface exposing a method for processing raw form of ranges.
  • 方法概要

    修饰符和类型
    方法
    说明
    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).
    Collection<com.google.common.collect.Range<T>>
    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
     
    boolean
    contains(long key, long value)
    Determines whether any of this range set's member ranges contains value.
    com.google.common.collect.Range<T>
    It returns very first smallest range in the rangeSet.
    void
    Performs the given action for each entry in this map until all entries have been processed or action returns "false".
    void
    Performs the given action for each entry in this map until all entries have been processed or action returns "false".
    void
    Performs the given action for each entry in this map until all entries have been processed or action returns "false".
    boolean
     
    com.google.common.collect.Range<T>
    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
    Returns total number of ranges into the set.
    com.google.common.collect.Range<T>
    Returns the minimal range which encloses all ranges in this range set.
  • 方法详细资料

    • 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.
      参数:
      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.
      返回:
    • asRanges

      Collection<com.google.common.collect.Range<T>> asRanges()
      Returns a view of the disconnected ranges that make up this range set.
      返回:
    • 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.)
      参数:
      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.)
      参数:
      action -
      consumer -
    • forEachRawRange

      void forEachRawRange(LongPairRangeSet.RawRangeProcessor 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.) This method is optimized on reducing intermediate object creation. to do iteration jobs.
    • size

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

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

      com.google.common.collect.Range<T> lastRange()
      It returns very last biggest range in the rangeSet.
      返回:
      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).