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 TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) booleanaddAll(TxnCollection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).booleanaddAll(Txn tx, Collection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).booleanaddAll(Txn tx, TxnCollection<? extends E> c) Adds all of the elements in the specified collection to this collection (optional operation).voidclear()booleanbooleancontainsAll(Collection<?> c) booleancontainsAll(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.booleanisEmpty()booleanReturns true if this collection contains no elements.iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArrayMethods inherited from interface org.multiverse.api.collections.TxnCollection
add, clear, contains, remove, size, toStringMethods inherited from interface org.multiverse.api.collections.TxnIterable
iterator
-
Field Details
-
stm
-
defaultRefFactory
-
-
Constructor Details
-
AbstractTxnCollection
-
-
Method Details
-
getStm
Description copied from interface:TxnCollectionReturns the STM that manages this TxnCollection. Returned value will never be null.- Specified by:
getStmin interfaceTxnCollection<E>- Returns:
- the STM that manages this TxnCollection.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>
-
isEmpty
Description copied from interface:TxnCollectionReturns true if this collection contains no elements.- Specified by:
isEmptyin interfaceTxnCollection<E>- Parameters:
tx- the transaction used for this operation.- Returns:
- true if this collection contains no elements
-
size
public int size()- Specified by:
sizein interfaceCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>
-
containsAll
Description copied from interface:TxnCollectionReturns true if this collection contains all of the elements in the specified collection.- Specified by:
containsAllin 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:
removein interfaceCollection<E>
-
add
- Specified by:
addin interfaceCollection<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>
-
addAll
Description copied from interface:TxnCollectionAdds 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:
addAllin 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:TxnCollectionAdds 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:
addAllin 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:TxnCollectionAdds 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:
addAllin 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:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceTxnIterable<E>
-
toString
-
toArray
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>
-