Package org.jruby.util.collections
Class WeakHashSet<T>
java.lang.Object
org.jruby.util.collections.WeakHashSet<T>
- Type Parameters:
T
- type
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,Collection<T>
,Set<T>
A simple set that uses weak references to ensure that its elements can be garbage collected.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> coll) void
clear()
clone()
boolean
boolean
containsAll
(Collection<?> coll) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> coll) boolean
retainAll
(Collection<?> coll) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] arr) toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
WeakHashSet
public WeakHashSet() -
WeakHashSet
public WeakHashSet(int size)
-
-
Method Details
-
add
-
remove
-
iterator
-
size
public int size() -
isEmpty
public boolean isEmpty() -
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
-
removeAll
-
retainAll
-
addAll
-
toArray
-
toArray
public <T> T[] toArray(T[] arr) -
equals
-
hashCode
public int hashCode() -
clone
-
toString
-