|
org.openide.util 6.8.31 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
org.openide.util.WeakSet
public class WeakSet
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 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(Object 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 |
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()
|
Object[] |
toArray(Object[] 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 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(Object o)
add in interface Collectionadd in interface Setadd in class AbstractCollectiono - an Object to addpublic void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionpublic Object clone()
public boolean contains(Object o)
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectiono - an Object to examinepublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface SetisEmpty in class AbstractCollectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionpublic boolean remove(Object o)
remove in interface Collectionremove in interface Setremove in class AbstractCollectiono - an Object to remove
public int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionpublic Object[] toArray(Object[] array)
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollectionpublic Object[] toArray()
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollectionpublic String toString()
toString in class AbstractCollection
|
org.openide.util 6.8.31 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||