Package org.apache.calcite.util
Class IntegerIntervalSet
A set of non-negative integers defined by a sequence of points, intervals,
and exclusions.
-
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
of
Parses a range of integers expressed as a string. The string can contain non-negative integers separated by commas, ranges (represented by a hyphen between two integers), and exclusions (represented by a preceding hyphen). For example, "1,2,3-20,-7,-10-15,12".Inclusions and exclusions are performed in the order that they are seen. For example, "1-10,-2-9,3-7,-4-6" does contain 3, because it is included by "1-10", excluded by "-2-9" and last included by "3-7". But it does not include 4.
- Parameters:
s
- Range set
-
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<Integer>
- Specified by:
size
in interfaceSet<Integer>
- Specified by:
size
in classAbstractCollection<Integer>
-
contains
- Specified by:
contains
in interfaceCollection<Integer>
- Specified by:
contains
in interfaceSet<Integer>
- Overrides:
contains
in classAbstractCollection<Integer>
-
contains
public boolean contains(int n)
-