public class IntArraySet extends AbstractIntSet implements Serializable, IntSet
| Modifier and Type | Field and Description |
|---|---|
static int[] |
EMPTY_INT_ARRAY |
| Constructor and Description |
|---|
IntArraySet()
Create an empty set
|
IntArraySet(IntArraySet input)
Create one IntArraySet as a copy of another
|
IntArraySet(IntHashSet input)
Create a set containing integers from the specified IntHashSet
|
| 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(Object other)
Test whether this set has exactly the same members as another set
|
int |
getFirst()
Get the first value in the set.
|
int[] |
getValues()
Get the set of integer values as an array
|
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 IntArraySet |
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
|
String |
toString() |
IntSet |
union(IntSet other)
Form a new set that is the union of this set with another set.
|
containsAll, except, intersectclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, except, intersectpublic IntArraySet()
public IntArraySet(IntHashSet input)
input - the set to be copiedpublic IntArraySet(IntArraySet input)
input - the set to be copiedpublic IntSet copy()
IntSetpublic IntSet mutableCopy()
IntSetmutableCopy in interface IntSetpublic void clear()
IntSetpublic int size()
IntSetpublic boolean isEmpty()
IntSetpublic int[] getValues()
public boolean contains(int value)
IntSetpublic boolean remove(int value)
IntSetpublic boolean add(int value)
public int getFirst()
ArrayIndexOutOfBoundsException - if the set is emptypublic IntIterator iterator()
public IntSet union(IntSet other)
union in interface IntSetunion in class AbstractIntSetother - the other setpublic static IntArraySet 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 boolean equals(Object other)
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.