|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.util.ints.AbstractIntCollection
kodkod.util.ints.AbstractIntSet
kodkod.util.ints.ArrayIntSet
public final class ArrayIntSet
An immutable set of integers, stored in a sorted array.
ints: set int |
Constructor Summary | |
---|---|
ArrayIntSet(int[] ints)
Constructs a set view for the given array. |
|
ArrayIntSet(IntSet s)
Constructs an ArrayIntSet that is equal to the given set. |
Method Summary | |
---|---|
int |
ceil(int i)
Returns the smallest element in this set that is greater than or equal to i. |
boolean |
contains(int i)
Returns true if i is in this set. |
boolean |
equals(java.lang.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. |
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 smallest element in this set. |
int |
min()
Returns the largest element in this set. |
int |
size()
Returns the number of elements in this collection. |
int[] |
toArray()
Returns the result of calling AbstractIntCollection.toArray(int[]) with a freshly constructed array of length this.size(). |
int[] |
toArray(int[] array)
Copies the elements of this collection into the specified array, provided that it is large enough, and returns it. If the array is not large enough, the effect of this method is the same as calling IntCollection.toArray(). |
Methods inherited from class kodkod.util.ints.AbstractIntSet |
---|
clone, iterator, toString |
Methods inherited from class kodkod.util.ints.AbstractIntCollection |
---|
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface kodkod.util.ints.IntSet |
---|
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll |
Constructor Detail |
---|
public ArrayIntSet(int[] ints)
this.ints' = ints |
all i, j: [0..ints.length) | i < j => array[i] <= array[j] |
public ArrayIntSet(IntSet s)
this.ints' = s.ints |
Method Detail |
---|
public IntIterator iterator(int from, int to)
IntSet.iterator(int, int)
public int size()
IntSet.size()
public int ceil(int i)
IntSet
IntSet.ceil(int)
public int floor(int i)
IntSet
IntSet.floor(int)
public boolean contains(int i)
contains
in interface IntCollection
contains
in interface IntSet
contains
in class AbstractIntCollection
IntSet.contains(int)
public int max()
max
in interface IntSet
max
in class AbstractIntSet
java.util.NoSuchElementException
- - no this.intsIntSet.max()
public int min()
min
in interface IntSet
min
in class AbstractIntSet
java.util.NoSuchElementException
- - no this.intsIntSet.min()
public int[] toArray()
toArray
in interface IntCollection
toArray
in interface IntSet
toArray
in class AbstractIntCollection
IntCollection.toArray()
public int[] toArray(int[] array)
toArray
in interface IntCollection
toArray
in interface IntSet
toArray
in class AbstractIntCollection
IntCollection.toArray(int[])
public 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.
hashCode
in interface IntSet
hashCode
in class AbstractIntSet
IntSet.hashCode()
public boolean equals(java.lang.Object o)
equals
in interface IntSet
equals
in class AbstractIntSet
IntSet.equals(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |