|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
edu.neu.ccs.quick.QuickHashSet
QuickHashSet extends HashSet by
adding one constructor and three methods addItems,
setItems, and removeItems that handle
an array of Object at once.
All constructors of the original HashSet class
are provided as well.
No changes are made to the internal data structure or to any inherited methods.
| Field Summary |
| Fields inherited from class java.util.HashSet |
|
| Constructor Summary | |
QuickHashSet()
A constructor that delegates to class HashSet. |
|
QuickHashSet(Collection c)
A constructor that delegates to class HashSet. |
|
QuickHashSet(int initialCapacity)
A constructor that delegates to class HashSet. |
|
QuickHashSet(int initialCapacity,
float loadFactor)
A constructor that delegates to class HashSet. |
|
QuickHashSet(Object[] items)
Constructor that adds the given array of items one-by-one to the hash set. |
|
| Method Summary | |
void |
addItems(Object[] items)
Method that adds the given array of items one-by-one to the hash set. |
void |
removeItems(Object[] items)
Method that removes the given array of items one-by-one from the hash set. |
void |
setItems(Object[] items)
Method that first clears this hash set of any existing items and then adds the given array of items one-by-one to the hash set. |
| Methods inherited from class java.util.HashSet |
add, clear, clone, contains, isEmpty, iterator, remove, size |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
public QuickHashSet()
HashSet.
public QuickHashSet(Collection c)
HashSet.
public QuickHashSet(int initialCapacity)
HashSet.
public QuickHashSet(int initialCapacity,
float loadFactor)
HashSet.
public QuickHashSet(Object[] items)
Constructor that adds the given array of items one-by-one to the hash set.
The capacity is set either to 10 or to 1.5 times the length of the
array items whichever is larger.
The load factor is set to the default of 0.75.
items - the array of items to add to this hash setaddItems(Object[])| Method Detail |
public void addItems(Object[] items)
Method that adds the given array of items one-by-one to the hash set.
If items is null, then does nothing.
items - the array of items to add to this hash setQuickHashSet(Object[]),
setItems(Object[]),
removeItems(Object[])public void setItems(Object[] items)
Method that first clears this hash set of any existing items and then adds the given array of items one-by-one to the hash set.
If items is null, then this method
is equivalent to the inherited method clear.
items - the array of items to add to this hash set after clearanceaddItems(Object[]),
removeItems(Object[])public void removeItems(Object[] items)
Method that removes the given array of items one-by-one from the hash set.
If items is null, then does nothing.
items - the array of items to remove from this hash setaddItems(Object[]),
setItems(Object[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||