Home

# Class goog.math.RangeSet

Constructs a new RangeSet, which can store numeric ranges. Ranges are treated as half-closed: that is, they are exclusive of their end value [start, end). New ranges added to the set which overlap the values in one or more existing ranges will be merged.

Instance Method Summary
| `__iterator__(boolean= opt_keys) ⇒ !goog.iter.Iterator` Returns an iterator that iterates over the ranges in the RangeSet.
| `add(?goog.math.Range a)` Adds a range to the set. If the new range overlaps existing values, those ranges will be merged.
| `clear()` Removes all values in the set.
| `clone() ⇒ !goog.math.RangeSet`
| `contains(?goog.math.Range a) ⇒ boolean` Determines whether a given range is in the set. Only succeeds if the entire range is available.
| `containsValue(number value) ⇒ boolean` Determines whether a given value is set in the RangeSet.
| `coveredLength() ⇒ number`
| `difference(!goog.math.RangeSet set) ⇒ !goog.math.RangeSet` Subtracts the ranges of another set from this one, returning the result as a new RangeSet.
| `getBounds() ⇒ ?goog.math.Range`
| `intersection(?goog.math.RangeSet set) ⇒ !goog.math.RangeSet` Intersects this RangeSet with another.
| `inverse(?goog.math.Range range) ⇒ !goog.math.RangeSet` Creates an inverted slice of this set over the input range.
| `isEmpty() ⇒ boolean`
| `remove(?goog.math.Range a)` Removes a range of values from the set.
| `slice(?goog.math.Range range) ⇒ !goog.math.RangeSet` Creates a subset of this set over the input range.
| `toString() ⇒ string`
| `union(?goog.math.RangeSet set) ⇒ !goog.math.RangeSet` Returns the union of this RangeSet with another.

Static Method Summary
| `equals(?goog.math.RangeSet a, ?goog.math.RangeSet b) ⇒ boolean` Compares two sets for equality.