public class ObjectSet<T> extends ObjectTable<T>
| Modifier and Type | Field and Description |
|---|---|
static ObjectSet |
EMPTY_SET
An empty immutable
ObjectSet. |
keyTablecurrEntry, hashTable, minHashSize, nextTable| Constructor and Description |
|---|
ObjectSet(int initialSize)
Constructs an empty ObjectSet, allocating an initial storage for the specified
number of elements
|
ObjectSet(T[] items)
Constructs an ObjectSet populated with the specified items, or an empty ObjectSet
if the parameter is null
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(List<T> list)
Adds each item in the list to this ObjectSet, or no-ops if list is null
|
void |
addAll(ObjectSet<? extends T> set)
Adds each item in the specified ObjectSet, or no-ops if the set is null
|
void |
addAll(T[] objs)
Adds each of the items in the specified array, or no-ops if the array is null
|
void |
checkPut(T key)
Adds the specified item to the set, or no-ops if the key is null
|
static <T> ObjectSet<T> |
emptySet() |
void |
put(T key)
Adds the specified item to the set
|
boolean |
remove(T key)
Remove the specified object from this ObjectSet
|
add, clear, clone, containsKey, hash, isEquivalent, iterator, keyArray, keyArray, keyAt, lookup, removeEntry, resize, toList, toStringcapacity, countCollisions, dumpNexts, isEmpty, linkIntoHashTable, partition, rehash, removeEntry, resize, size, sortequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final ObjectSet EMPTY_SET
ObjectSet.public ObjectSet(int initialSize)
initialSize - public ObjectSet(T[] items)
items - public static <T> ObjectSet<T> emptySet()
public void checkPut(T key)
key - the item to add (may be null)public void put(T key)
key - the (non-null) object to storepublic void addAll(List<T> list)
list - a list (may be null)public void addAll(ObjectSet<? extends T> set)
set - a set (may be null)public void addAll(T[] objs)
objs - an array (may be null)public boolean remove(T key)
key - the (non-null) object to removeCopyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.