Class IntegerInterval.Set

java.lang.Object
org.apache.cassandra.utils.IntegerInterval.Set
Enclosing class:
IntegerInterval

public static class IntegerInterval.Set extends 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 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

      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 Collection<IntegerInterval> intervals()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object