Package org.apache.cassandra.utils
Class IntegerInterval.Set
java.lang.Object
org.apache.cassandra.utils.IntegerInterval.Set
- Enclosing class:
- IntegerInterval
A mutable set of closed integer intervals, stored in normalized form (i.e. where overlapping intervals are
converted to a single interval covering both). Thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int start, int end) Adds an interval to the set, performing the necessary normalization.booleancovers(int start, int end) Returns true if the set completely covers the given interval.booleanReturns true if the set completely covers the given interval.booleaninthashCode()intReturns a lower bound for the whole set.toString()intReturns an upper bound for the whole set.
-
Constructor Details
-
Set
public Set()
-
-
Method Details
-
add
public void add(int start, int end) Adds an interval to the set, performing the necessary normalization. -
covers
Returns true if the set completely covers the given interval. -
covers
public boolean covers(int start, int end) Returns true if the set completely covers the given interval. -
lowerBound
public int lowerBound()Returns a lower bound for the whole set. Will throw if set is not empty. -
upperBound
public int upperBound()Returns an upper bound for the whole set. Will throw if set is not empty. -
intervals
-
hashCode
public int hashCode() -
equals
-
toString
-