|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.collections.shorts.AbstractShortCollection
edu.emory.mathcs.util.collections.shorts.AbstractShortSet
edu.emory.mathcs.util.collections.shorts.ShortRadkeHashSet
Hash set of short numbers. It uses open addressing with quadratic residue search to avoid clustering. No additional memory per entry is needed, there is therefore no memory allocation on add() unless rehashing is required.
Constructor Summary | |
ShortRadkeHashSet()
|
|
ShortRadkeHashSet(int minInitialCapacity)
|
|
ShortRadkeHashSet(int minInitialCapacity,
float loadFactor,
float resizeTreshold)
|
|
ShortRadkeHashSet(int minInitialCapacity,
short min,
short max)
|
|
ShortRadkeHashSet(int minInitialCapacity,
short min,
short max,
float loadFactor,
float resizeTreshold)
|
|
ShortRadkeHashSet(ShortCollection c)
|
|
ShortRadkeHashSet(ShortSet m)
|
Method Summary | |
boolean |
add(short elem)
Adds the specified number to this set if it is not already present and if it falls within the domain. |
void |
clear()
Removes all of the elements from this set. |
java.lang.Object |
clone()
|
boolean |
contains(short elem)
Returns true if this set contains the specified number; false otherwise. |
boolean |
equals(java.lang.Object other)
Two sets are equal if they consists of the same elements. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if this set is empty; false otherwise. |
ShortIterator |
iterator()
Returns the iterator over numbers contained in this set. |
short |
max()
The largest number that can be stored in this set. |
short |
min()
The smallest number that can be stored in this set. |
boolean |
remove(short elem)
Removes the specified number from this set if it is present. |
boolean |
removeAll(ShortCollection c)
Removes from this set all of its elements that are contained in the specified collection. |
boolean |
retainAll(ShortCollection c)
Retains only the elements in this set that are contained in the specified collection. |
int |
size()
Returns the number of elements in this set. |
short[] |
toArray()
Returns the newly allocated array containing all numbers from this set, in the order returned by its iterator. |
short[] |
toArray(short[] a)
Returns an array containing all of the numbers in this set. |
Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortSet |
addAll, addInterval, complementSet, containsInterval, removeInterval, retainInterval |
Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortCollection |
containsAll, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.emory.mathcs.util.collections.shorts.ShortSet |
containsAll |
Constructor Detail |
public ShortRadkeHashSet()
public ShortRadkeHashSet(int minInitialCapacity)
public ShortRadkeHashSet(int minInitialCapacity, short min, short max)
public ShortRadkeHashSet(int minInitialCapacity, float loadFactor, float resizeTreshold)
public ShortRadkeHashSet(int minInitialCapacity, short min, short max, float loadFactor, float resizeTreshold)
public ShortRadkeHashSet(ShortSet m)
public ShortRadkeHashSet(ShortCollection c)
Method Detail |
public short min()
ShortSet
min
in interface ShortSet
min
in class AbstractShortSet
public short max()
ShortSet
max
in interface ShortSet
max
in class AbstractShortSet
public boolean add(short elem)
ShortSet
add
in interface ShortSet
add
in class AbstractShortCollection
public boolean contains(short elem)
ShortSet
contains
in interface ShortSet
contains
in class AbstractShortCollection
public boolean remove(short elem)
ShortSet
remove
in interface ShortSet
remove
in class AbstractShortCollection
public void clear()
ShortSet
clear
in interface ShortSet
clear
in class AbstractShortCollection
public boolean isEmpty()
ShortSet
isEmpty
in interface ShortSet
isEmpty
in class AbstractShortSet
public int size()
ShortSet
size
in interface ShortSet
size
in class AbstractShortCollection
public ShortIterator iterator()
ShortSet
iterator
in interface ShortSet
iterator
in class AbstractShortCollection
public boolean equals(java.lang.Object other)
ShortSet
equals
in interface ShortSet
equals
in class AbstractShortSet
public int hashCode()
hashCode
in interface ShortSet
hashCode
in class AbstractShortSet
public java.lang.Object clone()
public boolean removeAll(ShortCollection c)
ShortSet
removeAll
in interface ShortSet
removeAll
in class AbstractShortSet
public boolean retainAll(ShortCollection c)
ShortSet
retainAll
in interface ShortSet
retainAll
in class AbstractShortSet
public short[] toArray(short[] a)
ShortSet
If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the ShortSet.toArray()
method, this method acts as bridge between
array-based and collection-based APIs. Further, this method may,
under certain circumstances, be used to save allocation costs.
toArray
in interface ShortSet
toArray
in class AbstractShortCollection
public short[] toArray()
ShortSet
toArray
in interface ShortSet
toArray
in class AbstractShortCollection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |