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.Object
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 Constructor Description Set()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int start, int end)
Adds an interval to the set, performing the necessary normalization.boolean
covers(int start, int end)
Returns true if the set completely covers the given interval.boolean
covers(IntegerInterval iv)
Returns true if the set completely covers the given interval.boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.Collection<IntegerInterval>
intervals()
int
lowerBound()
Returns a lower bound for the whole set.java.lang.String
toString()
int
upperBound()
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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-