| |
|
| org.openide.util.WeakSet
WeakSet | public class WeakSet extends AbstractSet implements Cloneable,Serializable(Code) | | Set which holds its members by using of WeakReferences.
MT level: unsafe.
Note: as of JDK 6.0 (b51), you can instead use
Set<T> s = Collections.newSetFromMap(new WeakHashMap<T, Boolean>());
author: Ales Novak |
Inner Class :class WeakSetIterator implements Iterator<E> | |
Inner Class :static class Entry extends WeakReference | |
Constructor Summary | |
public | WeakSet() Constructs a new set. | public | WeakSet(Collection<? extends E> c) Constructs a new set containing the elements in the specified collection. | public | WeakSet(int initialCapacity) | public | WeakSet(int initialCapacity, float loadFactor) |
Method Summary | |
public boolean | add(E o) Adds the specified element to this set if it is not already present. | void | checkRefQueue() Checks if the queue is empty if not pending weak refs are removed. | public void | clear() Removes all of the elements from this set. | public Object | clone() Returns a shallow copy of this WeakSet instance: the elements themselves are not cloned. | public boolean | contains(Object o) Returns true if this set contains the specified element. | int | hashIt(Object o) | public boolean | isEmpty() Returns true if this set contains no elements. | public Iterator<E> | iterator() Returns an iterator over the elements in this set. | long | modCount() | void | rehash() | public boolean | remove(Object o) Removes the given element from this set if it is present. | public int | size() the number of elements in this set (its cardinality). | public T[] | toArray(T[] array) | public Object[] | toArray() | public String | toString() |
iterChain | transient Entry<E> iterChain(Code) | | |
nullCount | long nullCount(Code) | | Count of null in this set
|
serialVersionUID | final static long serialVersionUID(Code) | | |
WeakSet | public WeakSet()(Code) | | Constructs a new set.
|
WeakSet | public WeakSet(Collection<? extends E> c)(Code) | | Constructs a new set containing the elements in the specified collection.
Parameters: c - a collection to add |
WeakSet | public WeakSet(int initialCapacity)(Code) | | Constructs a new, empty set;
Parameters: initialCapacity - initial capacity |
WeakSet | public WeakSet(int initialCapacity, float loadFactor)(Code) | | Constructs a new, empty set;
Parameters: initialCapacity - initial capacity Parameters: loadFactor - load factor |
add | public boolean add(E o)(Code) | | Adds the specified element to this set if it is not already present.
Parameters: o - an Object to add |
checkRefQueue | void checkRefQueue()(Code) | | Checks if the queue is empty if not pending weak refs are removed.
|
clear | public void clear()(Code) | | Removes all of the elements from this set.
|
clone | public Object clone()(Code) | | Returns a shallow copy of this WeakSet instance: the elements themselves are not cloned.
|
contains | public boolean contains(Object o)(Code) | | Returns true if this set contains the specified element.
Parameters: o - an Object to examine |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this set contains no elements.
|
iterator | public Iterator<E> iterator()(Code) | | Returns an iterator over the elements in this set.
|
modCount | long modCount()(Code) | | modcount |
rehash | void rehash()(Code) | | rehashes this Set
|
remove | public boolean remove(Object o)(Code) | | Removes the given element from this set if it is present.
Parameters: o - an Object to remove true if and only if the Object was successfuly removed. |
size | public int size()(Code) | | the number of elements in this set (its cardinality). |
toArray | public T[] toArray(T[] array)(Code) | | |
|
|
|