|
org.openide.util 6.8.31 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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 capacitypublic WeakSet(int initialCapacity, float loadFactor)
initialCapacity
- initial capacityloadFactor
- load factorMethod Detail |
---|
public boolean add(Object o)
add
in interface Collection
add
in interface Set
add
in class AbstractCollection
o
- an Object to addpublic void clear()
clear
in interface Collection
clear
in interface Set
clear
in class AbstractCollection
public Object clone()
public boolean contains(Object o)
contains
in interface Collection
contains
in interface Set
contains
in class AbstractCollection
o
- an Object to examinepublic boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface Set
isEmpty
in class AbstractCollection
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface Set
iterator
in class AbstractCollection
public boolean remove(Object o)
remove
in interface Collection
remove
in interface Set
remove
in class AbstractCollection
o
- an Object to remove
public int size()
size
in interface Collection
size
in interface Set
size
in class AbstractCollection
public Object[] toArray(Object[] array)
toArray
in interface Collection
toArray
in interface Set
toArray
in class AbstractCollection
public Object[] toArray()
toArray
in interface Collection
toArray
in interface Set
toArray
in class AbstractCollection
public 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 |