Package org.multiverse.collections
Class AbstractTxnCollection<E>
java.lang.Object
org.multiverse.collections.AbstractTxnCollection<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,TxnCollection<E>
,TxnIterable<E>
- Direct Known Subclasses:
NaiveTxnHashSet
,NaiveTxnLinkedList
,NaiveTxnStack
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) boolean
addAll
(TxnCollection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).boolean
addAll
(Txn tx, Collection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).boolean
addAll
(Txn tx, TxnCollection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
containsAll
(Txn tx, Collection<?> c) Returns true if this collection contains all of the elements in the specified collection.getStm()
Returns the STM that manages this TxnCollection.boolean
isEmpty()
boolean
Returns true if this collection contains no elements.iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
Methods inherited from interface org.multiverse.api.collections.TxnCollection
add, clear, contains, remove, size, toString
Methods inherited from interface org.multiverse.api.collections.TxnIterable
iterator
-
Field Details
-
stm
-
defaultRefFactory
-
-
Constructor Details
-
AbstractTxnCollection
-
-
Method Details
-
getStm
Description copied from interface:TxnCollection
Returns the STM that manages this TxnCollection. Returned value will never be null.- Specified by:
getStm
in interfaceTxnCollection<E>
- Returns:
- the STM that manages this TxnCollection.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
-
isEmpty
Description copied from interface:TxnCollection
Returns true if this collection contains no elements.- Specified by:
isEmpty
in interfaceTxnCollection<E>
- Parameters:
tx
- the transaction used for this operation.- Returns:
- true if this collection contains no elements
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
-
containsAll
Description copied from interface:TxnCollection
Returns true if this collection contains all of the elements in the specified collection.- Specified by:
containsAll
in interfaceTxnCollection<E>
- Parameters:
tx
- the transaction used for this operation.c
- collection to be checked for containment in this collection- Returns:
- true if this collection contains all of the elements in the specified collection
- See Also:
-
remove
- Specified by:
remove
in interfaceCollection<E>
-
add
- Specified by:
add
in interfaceCollection<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
-
addAll
Description copied from interface:TxnCollection
Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)- Specified by:
addAll
in interfaceTxnCollection<E>
- Parameters:
tx
- the transaction used for this operation.c
- collection containing elements to be added to this collection- Returns:
- true if this collection changed as a result of the call
- See Also:
-
addAll
Description copied from interface:TxnCollection
Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)- Specified by:
addAll
in interfaceTxnCollection<E>
- Parameters:
c
- collection containing elements to be added to this collection- Returns:
- true if this collection changed as a result of the call
- See Also:
-
addAll
Description copied from interface:TxnCollection
Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)- Specified by:
addAll
in interfaceTxnCollection<E>
- Parameters:
c
- collection containing elements to be added to this collection- Returns:
- true if this collection changed as a result of the call
- See Also:
-
iterator
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in interfaceTxnIterable<E>
-
toString
-
toArray
- Specified by:
toArray
in interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
-