E
- public final class NaiveTxnLinkedList<E> extends AbstractTxnCollection<E> implements TxnDeque<E>, TxnList<E>
defaultRefFactory, stm
Constructor and Description |
---|
NaiveTxnLinkedList(Stm stm) |
NaiveTxnLinkedList(Stm stm,
int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Txn tx,
E e)
Ensures that this collection contains the specified element (optional
operation).
|
void |
addFirst(E e) |
void |
addFirst(Txn tx,
E e) |
void |
addLast(E e) |
void |
addLast(Txn tx,
E e) |
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.
|
TxnIterator<E> |
descendingIterator() |
TxnIterator<E> |
descendingIterator(Txn tx) |
E |
element() |
E |
element(Txn tx) |
E |
get(int index) |
E |
get(Txn tx,
int index) |
int |
getCapacity() |
E |
getFirst() |
E |
getFirst(Txn tx) |
E |
getLast() |
E |
getLast(Txn tx) |
int |
indexOf(Object item) |
int |
indexOf(Txn tx,
Object item) |
TxnIterator<E> |
iterator(Txn tx)
Returns an iterator over a set of elements of type T.
|
int |
lastIndexOf(Object item) |
int |
lastIndexOf(Txn tx,
Object item) |
boolean |
offer(E item) |
boolean |
offer(Txn tx,
E item) |
boolean |
offerFirst(E e) |
boolean |
offerFirst(Txn tx,
E item) |
boolean |
offerLast(E e) |
boolean |
offerLast(Txn tx,
E item) |
E |
peek() |
E |
peek(Txn tx) |
E |
peekFirst() |
E |
peekFirst(Txn tx) |
E |
peekLast() |
E |
peekLast(Txn tx) |
E |
poll() |
E |
poll(Txn tx) |
E |
pollFirst() |
E |
pollFirst(Txn tx) |
E |
pollLast() |
E |
pollLast(Txn tx) |
E |
pop() |
E |
pop(Txn tx) |
void |
push(E e) |
void |
push(Txn tx,
E e) |
void |
put(E item) |
void |
put(Txn tx,
E item) |
void |
putFirst(E item) |
void |
putFirst(Txn tx,
E item) |
void |
putLast(E item) |
void |
putLast(Txn tx,
E item) |
E |
remove() |
E |
remove(int index) |
E |
remove(Txn tx) |
E |
remove(Txn tx,
int index) |
boolean |
remove(Txn tx,
Object o)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
E |
removeFirst() |
E |
removeFirst(Txn tx) |
boolean |
removeFirstOccurrence(Object o) |
boolean |
removeFirstOccurrence(Txn tx,
Object o) |
E |
removeLast() |
E |
removeLast(Txn tx) |
boolean |
removeLastOccurrence(Object o) |
boolean |
removeLastOccurrence(Txn tx,
Object o) |
E |
set(int index,
E element) |
E |
set(Txn tx,
int index,
E element) |
int |
size(Txn tx)
Returns the number of elements in this collection.
|
E |
take() |
E |
take(Txn tx) |
E |
takeFirst() |
E |
takeFirst(Txn tx) |
E |
takeLast() |
E |
takeLast(Txn tx) |
String |
toString(Txn tx) |
add, addAll, addAll, addAll, addAll, clear, contains, containsAll, containsAll, getStm, isEmpty, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, addAll, addAll, containsAll, getStm, isEmpty
iterator
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public NaiveTxnLinkedList(Stm stm)
public NaiveTxnLinkedList(Stm stm, int capacity)
public int getCapacity()
getCapacity
in interface TxnQueue<E>
public int size(Txn tx)
TxnCollection
size
in interface TxnCollection<E>
tx
- the transaction used for this operation.public int lastIndexOf(Object item)
lastIndexOf
in interface TxnList<E>
public int lastIndexOf(Txn tx, Object item)
lastIndexOf
in interface TxnList<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(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 presentpublic void clear(Txn tx)
TxnCollection
clear
in interface TxnCollection<E>
tx
- the transaction used for this operation.public E element()
public E removeFirst()
removeFirst
in interface Deque<E>
public E removeFirst(Txn tx)
removeFirst
in interface TxnDeque<E>
public E removeLast()
removeLast
in interface Deque<E>
public E removeLast(Txn tx)
removeLast
in interface TxnDeque<E>
public E remove()
public boolean removeFirstOccurrence(Object o)
removeFirstOccurrence
in interface Deque<E>
public boolean removeFirstOccurrence(Txn tx, Object o)
removeFirstOccurrence
in interface TxnDeque<E>
public boolean removeLastOccurrence(Object o)
removeLastOccurrence
in interface Deque<E>
public boolean removeLastOccurrence(Txn tx, Object o)
removeLastOccurrence
in interface TxnDeque<E>
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 offerFirst(E e)
offerFirst
in interface Deque<E>
public boolean offerFirst(Txn tx, E item)
offerFirst
in interface TxnDeque<E>
public boolean offer(E item)
public E poll()
public E peek()
public TxnIterator<E> iterator(Txn tx)
TxnIterable
iterator
in interface TxnIterable<E>
tx
- the Txn used for this Operation.public TxnIterator<E> descendingIterator()
descendingIterator
in interface Deque<E>
public TxnIterator<E> descendingIterator(Txn tx)
descendingIterator
in interface TxnDeque<E>
public String toString(Txn tx)
toString
in interface TxnCollection<E>
Copyright © 2020. All rights reserved.