Package org.apache.cassandra.utils
Class IntegerInterval.Set
- java.lang.Object
-
- org.apache.cassandra.utils.IntegerInterval.Set
-
- Enclosing class:
- IntegerInterval
public static class IntegerInterval.Set extends java.lang.ObjectA 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 Constructor Description Set()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(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.booleancovers(IntegerInterval iv)Returns true if the set completely covers the given interval.booleanequals(java.lang.Object obj)inthashCode()java.util.Collection<IntegerInterval>intervals()intlowerBound()Returns a lower bound for the whole set.java.lang.StringtoString()intupperBound()Returns an upper bound for the whole set.
-
-
-
Method Detail
-
add
public void add(int start, int end)Adds an interval to the set, performing the necessary normalization.
-
covers
public boolean covers(IntegerInterval iv)
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
public java.util.Collection<IntegerInterval> intervals()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-