public class IntegerIntervalSet
extends java.util.AbstractSet<java.lang.Integer>
Modifier and Type | Class and Description |
---|---|
private static interface |
IntegerIntervalSet.Handler
A callback.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
s |
Modifier | Constructor and Description |
---|---|
private |
IntegerIntervalSet(java.lang.String s) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int n) |
boolean |
contains(java.lang.Object o) |
private Enumerator<java.lang.Integer> |
enumerator() |
java.util.Iterator<java.lang.Integer> |
iterator() |
static java.util.Set<java.lang.Integer> |
of(java.lang.String s)
Parses a range of integers expressed as a string.
|
int |
size() |
private static void |
visit(java.lang.String s,
IntegerIntervalSet.Handler handler) |
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private static void visit(java.lang.String s, IntegerIntervalSet.Handler handler)
public static java.util.Set<java.lang.Integer> of(java.lang.String s)
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.s
- Range setpublic java.util.Iterator<java.lang.Integer> iterator()
iterator
in interface java.lang.Iterable<java.lang.Integer>
iterator
in interface java.util.Collection<java.lang.Integer>
iterator
in interface java.util.Set<java.lang.Integer>
iterator
in class java.util.AbstractCollection<java.lang.Integer>
public int size()
size
in interface java.util.Collection<java.lang.Integer>
size
in interface java.util.Set<java.lang.Integer>
size
in class java.util.AbstractCollection<java.lang.Integer>
private Enumerator<java.lang.Integer> enumerator()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<java.lang.Integer>
contains
in interface java.util.Set<java.lang.Integer>
contains
in class java.util.AbstractCollection<java.lang.Integer>
public boolean contains(int n)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.