public final class NaiveTxnHashSet<E> extends AbstractTxnCollection<E> implements TxnSet<E>
defaultRefFactory, stm
Constructor and Description |
---|
NaiveTxnHashSet(Stm stm) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Txn tx,
E e)
Ensures that this collection contains the specified element (optional
operation).
|
void |
clear(Txn tx)
Removes all of the elements from this collection (optional operation).
|
boolean |
contains(Object item) |
boolean |
contains(Txn tx,
Object o)
Returns true if this collection contains the specified element.
|
TxnIterator<E> |
iterator(Txn tx)
Returns an iterator over a set of elements of type T.
|
boolean |
remove(Object item) |
boolean |
remove(Txn tx,
Object item)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
int |
size(Txn tx)
Returns the number of elements in this collection.
|
String |
toString(Txn tx) |
add, addAll, addAll, addAll, addAll, clear, containsAll, containsAll, getStm, isEmpty, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, addAll, addAll, containsAll, getStm, isEmpty
iterator
add, addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
public NaiveTxnHashSet(Stm stm)
public boolean add(Txn tx, E e)
TxnCollection
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.
add
in interface TxnCollection<E>
tx
- the transaction used for this operation.e
- element whose presence in this collection is to be ensuredpublic boolean contains(Object item)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractTxnCollection<E>
public boolean contains(Txn tx, Object o)
TxnCollection
contains
in interface TxnCollection<E>
tx
- the transaction used for this operation.o
- element whose presence in this collection is to be testedpublic boolean remove(Object item)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractTxnCollection<E>
public boolean remove(Txn tx, Object item)
TxnCollection
remove
in interface TxnCollection<E>
tx
- the transaction used for this operation.item
- element to be removed from this collection, if presentpublic int size(Txn tx)
TxnCollection
size
in interface TxnCollection<E>
tx
- the transaction used for this operation.public void clear(Txn tx)
TxnCollection
clear
in interface TxnCollection<E>
tx
- the transaction used for this operation.public TxnIterator<E> iterator(Txn tx)
TxnIterable
iterator
in interface TxnIterable<E>
tx
- the Txn used for this Operation.public String toString(Txn tx)
toString
in interface TxnCollection<E>
Copyright © 2020. All rights reserved.