public interface IntSet extends IntCollection, Cloneable
ints: set int| Modifier and Type | Method and Description | 
|---|---|
| boolean | add(int i)Adds the given integer to this set if not already present
 and returns true. | 
| boolean | addAll(IntCollection c)Adds all of the elements in the specified collection to this set 
 if they're not already present. | 
| int | ceil(int i)Returns the smallest element in this set that 
 is greater than or equal to i. | 
| void | clear()Removes all elements from this set. | 
| IntSet | clone()Returns a copy of this IntSet. | 
| boolean | contains(int i)Returns true if i is in this set. | 
| boolean | containsAll(IntCollection c)Returns true if the elements of c are a subset of this set. | 
| boolean | equals(Object o)Compares the specified object with this set for equality. | 
| int | floor(int i)Returns the largest element in this set that 
 is smaller than or equal to i. | 
| int | hashCode()Returns the hash code value for this set. | 
| boolean | isEmpty()Returns true if this set has no elements; 
 otherwise returns false. | 
| IntIterator | iterator()Returns an iterator over the integers in this set,
 in the ascending element order. | 
| IntIterator | iterator(int from,
        int to)Returns an iterator over the elements of this set that
 are in the closed range [from..to]. | 
| int | max()Returns the largest element in this set. | 
| int | min()Returns the smallest element in this set. | 
| boolean | remove(int i)Removes the given integer from this set if already present and
 returns true. | 
| boolean | removeAll(IntCollection c)Removes from this set all of its elements that are contained in the 
 specified set. | 
| boolean | retainAll(IntCollection c)Retains only the elements in this set that are contained in the 
 specified set. | 
| int | size()Returns the cardinality of this set. | 
| int[] | toArray()Returns an array containing all of the elements in this set in the
 ascending order. | 
| int[] | toArray(int[] array)Copies the elements of this set into the specified array, in the ascending
 order, provided that the array is large enough. | 
boolean add(int i)
add in interface IntCollectionthis.ints' = this.ints + iIllegalArgumentException - this is a bounded set
 and i is out of boundsboolean addAll(IntCollection c)
addAll in interface IntCollectionthis.ints' = this.ints + { i: int | c.contains(i) }NullPointerException - c = nullUnsupportedOperationException - this is an unmodifiable setIllegalArgumentException - some aspect of an element of the specified 
 collection prevents it from being added to this collection.int ceil(int i)
NoSuchElementException - no this.ints || i > this.max()void clear()
clear in interface IntCollectionno this.ints'IntSet clone() throws CloneNotSupportedException
CloneNotSupportedException - this is not cloneableboolean contains(int i)
contains in interface IntCollectionboolean containsAll(IntCollection c)
containsAll in interface IntCollectionNullPointerException - c = nullboolean equals(Object o)
int floor(int i)
NoSuchElementException - no this.ints || i < this.min()int hashCode()
Ints.superFastHash(int[]) of the elements in the set, 
 taken in the ascending order of values.  
 This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() 
 for any two IntSets s1 and s2, as required by the general contract of the Object.hashCode method.boolean isEmpty()
isEmpty in interface IntCollectionIntIterator iterator()
iterator in interface IntCollectionIntIterator iterator(int from, int to)
int max()
NoSuchElementException - no this.intsint min()
NoSuchElementException - no this.intsboolean remove(int i)
remove in interface IntCollectionthis.ints' = this.ints - iboolean removeAll(IntCollection c)
removeAll in interface IntCollectionthis.ints' = this.ints - { i: int | c.contains(i) }NullPointerException - s = nullUnsupportedOperationException - this is an unmodifiable setboolean retainAll(IntCollection c)
retainAll in interface IntCollectionthis.ints' = this.ints & { i: int | c.contains(i) }NullPointerException - s = nullUnsupportedOperationException - this is an unmodifiable setint size()
size in interface IntCollectionint[] toArray()
toArray in interface IntCollectionint[] toArray(int[] array)
toArray in interface IntCollectionarray.length>=this.size() => all i: [0..this.size()) | array'[i] in this.ints and #{e: this.ints | e < array'[i]} = iNullPointerException - array = null
© Emina Torlak 2005-present