E
- public interface TxnCollection<E> extends TxnIterable<E>, Collection<E>
Modifier and Type | Method and Description |
---|---|
boolean |
add(Txn txn,
E e)
Ensures that this collection contains the specified element (optional
operation).
|
boolean |
addAll(TxnCollection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
boolean |
addAll(Txn txn,
Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
boolean |
addAll(Txn txn,
TxnCollection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
void |
clear(Txn txn)
Removes all of the elements from this collection (optional operation).
|
boolean |
contains(Txn txn,
Object o)
Returns true if this collection contains the specified element.
|
boolean |
containsAll(Txn txn,
Collection<?> c)
Returns true if this collection contains all of the elements
in the specified collection.
|
Stm |
getStm()
Returns the STM that manages this TxnCollection.
|
boolean |
isEmpty(Txn txn)
Returns true if this collection contains no elements.
|
boolean |
remove(Txn txn,
Object o)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
int |
size(Txn txn)
Returns the number of elements in this collection.
|
String |
toString(Txn txn) |
iterator, iterator
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
Stm getStm()
boolean isEmpty(Txn txn)
txn
- the transaction used for this operation.int size(Txn txn)
txn
- the transaction used for this operation.boolean contains(Txn txn, Object o)
txn
- the transaction used for this operation.o
- element whose presence in this collection is to be testedClassCastException
- if the type of the specified element
is incompatible with this collection (optional)NullPointerException
- if the specified element is null and this
collection does not permit null elements (optional)boolean containsAll(Txn txn, Collection<?> c)
txn
- the transaction used for this operation.c
- collection to be checked for containment in this collectionClassCastException
- if the types of one or more elements
in the specified collection are incompatible with this
collection (optional)NullPointerException
- if the specified collection contains one
or more null elements and this collection does not permit null
elements (optional), or if the specified collection is nullCollection.contains(Object)
boolean remove(Txn txn, Object o)
txn
- the transaction used for this operation.o
- element to be removed from this collection, if presentClassCastException
- if the type of the specified element
is incompatible with this collection (optional)NullPointerException
- if the specified element is null and this
collection does not permit null elements (optional)UnsupportedOperationException
- if the remove operation
is not supported by this collectionvoid clear(Txn txn)
txn
- the transaction used for this operation.UnsupportedOperationException
- if the clear operation
is not supported by this collectionboolean add(Txn txn, E e)
Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.
If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.
txn
- the transaction used for this operation.e
- element whose presence in this collection is to be ensuredUnsupportedOperationException
- if the add operation
is not supported by this collectionClassCastException
- if the class of the specified element
prevents it from being added to this collectionNullPointerException
- if the specified element is null and this
collection does not permit null elementsIllegalArgumentException
- if some property of the element
prevents it from being added to this collectionIllegalStateException
- if the element cannot be added at this
time due to insertion restrictionsboolean addAll(Txn txn, Collection<? extends E> c)
txn
- the transaction used for this operation.c
- collection containing elements to be added to this collectionUnsupportedOperationException
- if the addAll operation
is not supported by this collectionClassCastException
- if the class of an element of the specified
collection prevents it from being added to this collectionNullPointerException
- if the specified collection contains a
null element and this collection does not permit null elements,
or if the specified collection is nullIllegalArgumentException
- if some property of an element of the
specified collection prevents it from being added to this
collectionIllegalStateException
- if not all the elements can be added at
this time due to insertion restrictionsCollection.add(Object)
boolean addAll(TxnCollection<? extends E> c)
c
- collection containing elements to be added to this collectionUnsupportedOperationException
- if the addAll operation
is not supported by this collectionClassCastException
- if the class of an element of the specified
collection prevents it from being added to this collectionNullPointerException
- if the specified collection contains a
null element and this collection does not permit null elements,
or if the specified collection is nullIllegalArgumentException
- if some property of an element of the
specified collection prevents it from being added to this
collectionIllegalStateException
- if not all the elements can be added at
this time due to insertion restrictionsCollection.add(Object)
boolean addAll(Txn txn, TxnCollection<? extends E> c)
c
- collection containing elements to be added to this collectionUnsupportedOperationException
- if the addAll operation
is not supported by this collectionClassCastException
- if the class of an element of the specified
collection prevents it from being added to this collectionNullPointerException
- if the specified collection contains a
null element and this collection does not permit null elements,
or if the specified collection is nullIllegalArgumentException
- if some property of an element of the
specified collection prevents it from being added to this
collectionIllegalStateException
- if not all the elements can be added at
this time due to insertion restrictionsCollection.add(Object)
Copyright © 2020. All rights reserved.