|
org.openide.util 7.9.0 1 | |||||||||
| 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>
org.openide.util.WeakSet<E>
public class WeakSet<E>
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>());
| Constructor Summary | |
|---|---|
WeakSet()
Constructs a new set. |
|
WeakSet(Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. |
|
WeakSet(int initialCapacity)
Constructs a new, empty set; |
|
WeakSet(int initialCapacity,
float loadFactor)
Constructs a new, empty set; |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already present. |
|
void |
clear()
Removes all of the elements from this set. |
|
Object |
clone()
Returns a shallow copy of this WeakSet instance: the elements themselves are not cloned. |
|
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
|
boolean |
isEmpty()
Returns true if this set contains no elements. |
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set. |
|
boolean |
remove(Object o)
Removes the given element from this set if it is present. |
|
int |
size()
|
|
Object[] |
toArray()
|
|
|
toArray(T[] array)
|
|
String |
toString()
|
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, retainAll |
| Constructor Detail |
|---|
public WeakSet()
public WeakSet(Collection<? extends E> c)
c - a collection to addpublic WeakSet(int initialCapacity)
initialCapacity - initial capacity
public WeakSet(int initialCapacity,
float loadFactor)
initialCapacity - initial capacityloadFactor - load factor| Method Detail |
|---|
public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>o - an Object to addpublic void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public Object clone()
public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>o - an Object to examinepublic boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public Iterator<E> iterator()
public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>o - an Object to remove
public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public <T> T[] toArray(T[] array)
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>toArray in class AbstractCollection<E>public String toString()
toString in class AbstractCollection<E>
|
org.openide.util 7.9.0 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||