public class MonotonicIntSet extends AbstractIntSet implements IntSet
Constructor and Description |
---|
MonotonicIntSet()
Create an empty set
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int value)
Add an integer to the set
|
void |
clear()
Clear the contents of the IntSet (making it an empty set)
|
boolean |
contains(int value)
Determine whether a particular integer is present in the set
|
IntSet |
copy()
Create a copy of this IntSet that leaves the original unchanged.
|
boolean |
equals(java.lang.Object other)
Test whether this set has exactly the same members as another set
|
int |
hashCode()
Construct a hash key that supports the equals() test
|
boolean |
isEmpty()
Determine if the set is empty
|
IntIterator |
iterator()
Get an iterator over the values
|
static MonotonicIntSet |
make(int[] in,
int size)
Factory method to construct a set from an array of integers
|
IntSet |
mutableCopy()
Create a copy of this IntSet that contains the same set of integers.
|
boolean |
remove(int value)
Remove an integer from the set
|
int |
size()
Get the number of integers in the set
|
java.lang.String |
toString() |
IntSet |
union(IntSet other)
Form a new set that is the union of this set with another set.
|
containsAll, except, intersect
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, except, intersect
public IntSet copy()
IntSet
public IntSet mutableCopy()
IntSet
mutableCopy
in interface IntSet
public void clear()
IntSet
public int size()
IntSet
public boolean isEmpty()
IntSet
public boolean contains(int value)
IntSet
public boolean remove(int value)
IntSet
public boolean add(int value)
add
in interface IntSet
value
- the integer to be added (which must be greater than or equal to the
largest integer currently in the set)java.lang.UnsupportedOperationException
- if the set already contains an integer larger
than the supplied valuepublic IntIterator iterator()
public IntSet union(IntSet other)
union
in interface IntSet
union
in class AbstractIntSet
other
- the other setpublic static MonotonicIntSet make(int[] in, int size)
in
- the array of integers, which must be in ascending ordersize
- the number of elements in the array that are significantpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.