|
||||||||||
| 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 ShortSetmin in class AbstractShortSetpublic short max()
ShortSet
max in interface ShortSetmax in class AbstractShortSetpublic boolean add(short elem)
ShortSet
add in interface ShortSetadd in class AbstractShortCollectionpublic boolean contains(short elem)
ShortSet
contains in interface ShortSetcontains in class AbstractShortCollectionpublic boolean remove(short elem)
ShortSet
remove in interface ShortSetremove in class AbstractShortCollectionpublic void clear()
ShortSet
clear in interface ShortSetclear in class AbstractShortCollectionpublic boolean isEmpty()
ShortSet
isEmpty in interface ShortSetisEmpty in class AbstractShortSetpublic int size()
ShortSet
size in interface ShortSetsize in class AbstractShortCollectionpublic ShortIterator iterator()
ShortSet
iterator in interface ShortSetiterator in class AbstractShortCollectionpublic boolean equals(java.lang.Object other)
ShortSet
equals in interface ShortSetequals in class AbstractShortSetpublic int hashCode()
hashCode in interface ShortSethashCode in class AbstractShortSetpublic java.lang.Object clone()
public boolean removeAll(ShortCollection c)
ShortSet
removeAll in interface ShortSetremoveAll in class AbstractShortSetpublic boolean retainAll(ShortCollection c)
ShortSet
retainAll in interface ShortSetretainAll in class AbstractShortSetpublic short[] toArray(short[] a)
ShortSetIf 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 ShortSettoArray in class AbstractShortCollectionpublic short[] toArray()
ShortSet
toArray in interface ShortSettoArray in class AbstractShortCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||