public class

WeakBag

extends Object
implements Iterable<T>
java.lang.Object
   ↳ com.mongodb.util.WeakBag<T>

Class Overview

if its not obvious what a weak bag should do, then, well... very very not thead safe

Summary

Public Constructors
WeakBag()
Initializes a new weak bag.
Public Methods
void add(T t)
Adds an element to the bag.
void clean()
Removes any null objects from the bag.
void clear()
Removes all object from the bag.
boolean contains(T t)
List<T> getAll()
Iterator<T> iterator()
boolean remove(T t)
int size()
Returns the size of the bag.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable

Public Constructors

public WeakBag ()

Initializes a new weak bag.

Public Methods

public void add (T t)

Adds an element to the bag.

Parameters
t Element to add

public void clean ()

Removes any null objects from the bag.

public void clear ()

Removes all object from the bag.

public boolean contains (T t)

public List<T> getAll ()

public Iterator<T> iterator ()

public boolean remove (T t)

public int size ()

Returns the size of the bag.

Returns
  • the size of the bag