public class IntegerIntervalSet extends AbstractSet<Integer>
| Modifier and Type | Class and Description |
|---|---|
private static interface |
IntegerIntervalSet.Handler
A callback.
|
| Modifier | Constructor and Description |
|---|---|
private |
IntegerIntervalSet(String s) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int n) |
boolean |
contains(Object o) |
private Enumerator<Integer> |
enumerator() |
Iterator<Integer> |
iterator() |
static Set<Integer> |
of(String s)
Parses a range of integers expressed as a string.
|
int |
size() |
private static void |
visit(String s,
IntegerIntervalSet.Handler handler) |
equals, hashCode, removeAlladd, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streamprivate final String s
private IntegerIntervalSet(String s)
private static void visit(String s, IntegerIntervalSet.Handler handler)
public static Set<Integer> of(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 int size()
size in interface Collection<Integer>size in interface Set<Integer>size in class AbstractCollection<Integer>private Enumerator<Integer> enumerator()
public boolean contains(Object o)
contains in interface Collection<Integer>contains in interface Set<Integer>contains in class AbstractCollection<Integer>public boolean contains(int n)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.