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(java.lang.Object item) |
boolean |
contains(Txn tx,
java.lang.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(java.lang.Object item) |
boolean |
remove(Txn tx,
java.lang.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.
|
java.lang.String |
toString(Txn tx) |
add, addAll, addAll, addAll, addAll, clear, containsAll, containsAll, getStm, isEmpty, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, addAll, addAll, containsAll, getStm, isEmptyiteratorpublic NaiveTxnHashSet(Stm stm)
public boolean add(Txn tx, E e)
TxnCollectionCollections 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(java.lang.Object item)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>contains in class AbstractTxnCollection<E>public boolean contains(Txn tx, java.lang.Object o)
TxnCollectioncontains in interface TxnCollection<E>tx - the transaction used for this operation.o - element whose presence in this collection is to be testedpublic boolean remove(java.lang.Object item)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>remove in class AbstractTxnCollection<E>public boolean remove(Txn tx, java.lang.Object item)
TxnCollectionremove 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)
TxnCollectionsize in interface TxnCollection<E>tx - the transaction used for this operation.public void clear(Txn tx)
TxnCollectionclear in interface TxnCollection<E>tx - the transaction used for this operation.public TxnIterator<E> iterator(Txn tx)
TxnIterableiterator in interface TxnIterable<E>tx - the Txn used for this Operation.public java.lang.String toString(Txn tx)
toString in interface TxnCollection<E>