Class ConcurrentLinkedBag<T>
java.lang.Object
edu.harvard.seas.pl.abcdatalog.util.datastructures.ConcurrentLinkedBag<T>
- Type Parameters:
T
- the type of the element of the bag
- All Implemented Interfaces:
Iterable<T>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an element to the bag.static final <T> ConcurrentLinkedBag
<T> emptyBag()
getHead()
Returns the head of the linked-list that backs this bag, or null if there is no head.iterator()
Returns an iterator over elements of type T.size()
Returns the number of elements that have been added to the set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ConcurrentLinkedBag
public ConcurrentLinkedBag()
-
-
Method Details
-
add
-
size
Returns the number of elements that have been added to the set.- Returns:
- the size of the set
-
getHead
Returns the head of the linked-list that backs this bag, or null if there is no head.- Returns:
- the head, or null
-
iterator
-
emptyBag
-