|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.collections.AbstractTxnCollection<E>
org.multiverse.collections.NaiveTxnStack<E>
public final class NaiveTxnStack<E>
| Field Summary |
|---|
| Fields inherited from class org.multiverse.collections.AbstractTxnCollection |
|---|
defaultRefFactory, stm |
| Constructor Summary | |
|---|---|
NaiveTxnStack(Stm stm)
|
|
NaiveTxnStack(Stm stm,
int capacity)
|
|
| Method Summary | |
|---|---|
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(Txn tx,
Object o)
Returns true if this collection contains the specified element. |
int |
getCapacity()
|
TxnIterator<E> |
iterator(Txn tx)
Returns an iterator over a set of elements of type T. |
boolean |
offer(E item)
|
boolean |
offer(Txn tx,
E item)
|
E |
peek()
|
E |
peek(Txn tx)
|
E |
poll()
|
E |
poll(Txn tx)
|
E |
pop()
|
E |
pop(Txn tx)
|
void |
push(E item)
|
void |
push(Txn tx,
E item)
|
boolean |
remove(Txn tx,
Object o)
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)
|
| Methods inherited from class org.multiverse.collections.AbstractTxnCollection |
|---|
add, addAll, addAll, addAll, addAll, clear, contains, containsAll, containsAll, getStm, isEmpty, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.multiverse.api.collections.TxnCollection |
|---|
addAll, addAll, addAll, containsAll, getStm, isEmpty |
| Methods inherited from interface org.multiverse.api.collections.TxnIterable |
|---|
iterator |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
|---|
public NaiveTxnStack(Stm stm)
public NaiveTxnStack(Stm stm,
int capacity)
| Method Detail |
|---|
public int size(Txn tx)
TxnCollection
size in interface TxnCollection<E>tx - the transaction used for this operation.
public int getCapacity()
getCapacity in interface TxnStack<E>public void clear(Txn tx)
TxnCollection
clear in interface TxnCollection<E>tx - the transaction used for this operation.public boolean offer(E item)
offer in interface TxnStack<E>
public boolean offer(Txn tx,
E item)
offer in interface TxnStack<E>public E poll()
poll in interface TxnStack<E>public E poll(Txn tx)
poll in interface TxnStack<E>public E peek()
peek in interface TxnStack<E>public E peek(Txn tx)
peek in interface TxnStack<E>public void push(E item)
push in interface TxnStack<E>
public void push(Txn tx,
E item)
push in interface TxnStack<E>public E pop()
pop in interface TxnStack<E>public E pop(Txn tx)
pop in interface TxnStack<E>
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 ensured
public TxnIterator<E> iterator(Txn tx)
TxnIterable
iterator in interface TxnIterable<E>tx - the Txn used for this Operation.
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 tested
public boolean remove(Txn tx,
Object o)
TxnCollection
remove in interface TxnCollection<E>tx - the transaction used for this operation.o - element to be removed from this collection, if present
public String toString(Txn tx)
toString in interface TxnCollection<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||