|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
zombie.core.Collections.ZomboidHashSet<E>
public class ZomboidHashSet<E>
Constructor Summary | |
---|---|
ZomboidHashSet()
Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75). |
|
ZomboidHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. |
|
ZomboidHashSet(int initialCapacity)
Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor (0.75). |
|
ZomboidHashSet(int initialCapacity,
float loadFactor)
Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor. |
Method Summary | |
---|---|
boolean |
add(E e)
Adds the specified element to this set if it is not already present. |
void |
clear()
Removes all of the elements from this set. |
java.lang.Object |
clone()
Returns a shallow copy of this ZomboidHashSet instance: the elements themselves are not cloned. |
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
java.util.Iterator<E> |
iterator()
Returns an iterator over the elements in this set. |
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present. |
int |
size()
Returns the number of elements in this set (its cardinality). |
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 |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public ZomboidHashSet()
public ZomboidHashSet(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this set
java.lang.NullPointerException
- if the specified collection is nullpublic ZomboidHashSet(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hash maploadFactor
- the load factor of the hash map
java.lang.IllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositivepublic ZomboidHashSet(int initialCapacity)
initialCapacity
- the initial capacity of the hash table
java.lang.IllegalArgumentException
- if the initial capacity is less
than zeroMethod Detail |
---|
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.Set<E>
iterator
in class java.util.AbstractCollection<E>
ConcurrentModificationException
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.Set<E>
size
in class java.util.AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.Set<E>
isEmpty
in class java.util.AbstractCollection<E>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in interface java.util.Set<E>
contains
in class java.util.AbstractCollection<E>
o
- element whose presence in this set is to be tested
public boolean add(E e)
add
in interface java.util.Collection<E>
add
in interface java.util.Set<E>
add
in class java.util.AbstractCollection<E>
e
- element to be added to this set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.Set<E>
remove
in class java.util.AbstractCollection<E>
o
- object to be removed from this set, if present
public void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.Set<E>
clear
in class java.util.AbstractCollection<E>
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |