|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.transactional.collections.AbstractTransactionalDeque<E>
org.multiverse.transactional.collections.TransactionalLinkedList<E>
E - public final class TransactionalLinkedList<E>
A general purposes collection structure that could be considered a work horse because it implements a lot of interfaces:
IterableCollectionListQueueBlockingQueueDequeBlockingDeque
TransactionalCollection,
TransactionalQueue,
TransactionalDeque,
TransactionalList,
BlockingDeque,
BlockingQueue,
Queue,
Deque,
List| Nested Class Summary | |
|---|---|
class |
TransactionalLinkedList.DescendingIteratorImpl
|
class |
TransactionalLinkedList.IteratorImpl
|
class |
TransactionalLinkedList.ListIteratorImpl
|
static class |
TransactionalLinkedList.Node<E>
|
| Constructor Summary | |
|---|---|
TransactionalLinkedList()
Creates a new TransactionalLinkedList with unbound capacity. |
|
TransactionalLinkedList(Collection<E> items)
Creates a new TransactionalLinkedList with unbound capacity and the provided items. |
|
TransactionalLinkedList(E... items)
Creates a new TransactionalLinkedList with unbound capacity and the provided items. |
|
TransactionalLinkedList(int maxCapacity)
Creates a new TransactionalLinkedList with the provided max capacity. |
|
TransactionalLinkedList(int maxCapacity,
boolean relaxedMaximumCapacity)
Creates a new TransactionalLinkedList. |
|
| Method Summary | |
|---|---|
void |
add(int index,
E element)
|
boolean |
addAll(Collection<? extends E> c)
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
int |
atomicSize()
Returns the current size of the TransactionalCollection. |
void |
clear()
|
Iterator<E> |
descendingIterator()
|
protected void |
doAddFirst(E e)
|
protected void |
doAddLast(E e)
|
protected E |
doRemoveFirst()
|
protected E |
doRemoveLast()
|
boolean |
equals(Object thatObj)
|
E |
get(int index)
|
TransactionalLinkedList.Node<E> |
getHead()
|
int |
getMaxCapacity()
|
int |
hashCode()
|
boolean |
hasRelaxedMaxCapacity()
Checks if this TransactionalLinkedList uses a relaxed maximum capacity. |
int |
indexOf(Object o)
|
boolean |
isEmpty()
|
Iterator<E> |
iterator()
Returns an iterator over the elements contained in this collection. |
int |
lastIndexOf(Object o)
|
ListIterator<E> |
listIterator()
|
ListIterator<E> |
listIterator(int index)
|
E |
peekFirst()
|
E |
peekLast()
|
void |
putFirst(E e)
|
int |
remainingCapacity()
|
E |
remove(int index)
|
boolean |
remove(Object item)
|
E |
removeFirst()
|
E |
set(int index,
E element)
|
int |
size()
|
List<E> |
subList(int fromIndex,
int toIndex)
|
E |
takeLast()
|
| Methods inherited from class org.multiverse.transactional.collections.AbstractTransactionalDeque |
|---|
add, addFirst, addLast, contains, containsAll, drainTo, drainTo, element, getFirst, getLast, hasNoStorageCapacity, offer, offer, offerFirst, offerFirst, offerLast, offerLast, peek, poll, poll, pollFirst, pollFirst, pollLast, pollLast, pop, push, put, putLast, remove, removeAll, removeFirstOccurrence, removeLast, removeLastOccurrence, retainAll, take, takeFirst, takeUninterruptible, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
add, contains, containsAll, removeAll, retainAll, toArray, toArray |
| Methods inherited from interface org.multiverse.transactional.collections.TransactionalCollection |
|---|
add, contains, containsAll, removeAll, retainAll, toArray, toArray, toString |
| Constructor Detail |
|---|
public TransactionalLinkedList()
TransactionalLinkedList(int, boolean) as alternative.
public TransactionalLinkedList(E... items)
TransactionalLinkedList(int, boolean) as alternative.
items - the items to store in this TransactionalLinkedList.
NullPointerException - if items is null.public TransactionalLinkedList(Collection<E> items)
TransactionalLinkedList(int, boolean) as alternative.
items - the items to store in this TransactionalLinkedList.
NullPointerException - if items is null.public TransactionalLinkedList(int maxCapacity)
TransactionalLinkedList(int, boolean) as alternative.
maxCapacity - the maximum capacity of the queue.
IllegalArgumentException - if maxCapacity smaller than 0.
public TransactionalLinkedList(int maxCapacity,
boolean relaxedMaximumCapacity)
maxCapacity - the maximum number of items stores in this TransactionalLinkedList.relaxedMaximumCapacity - if the TransactionalLinkedList should be relaxed with it maxCapacity. If
it is strict, it leads to reduced concurrency. If it is relaxed, then
the number of items stored could exceed the maxCapacity. In most cases
this is not an issue.
IllegalArgumentException - if maxCapacity is smaller than 0.| Method Detail |
|---|
public boolean hasRelaxedMaxCapacity()
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>isEmpty in interface TransactionalCollection<E>isEmpty in class AbstractTransactionalDeque<E>public int atomicSize()
TransactionalCollectionTransactionalCollection.size() method is that this one returns the actual size of
this map and doesn't look at the current transaction. So you could see changes
made by other threads.
atomicSize in interface TransactionalCollection<E>public int size()
size in interface Collection<E>size in interface BlockingDeque<E>size in interface Deque<E>size in interface List<E>size in interface TransactionalCollection<E>size in class AbstractTransactionalDeque<E>public int remainingCapacity()
remainingCapacity in interface BlockingQueue<E>remainingCapacity in interface TransactionalQueue<E>public void clear()
clear in interface Collection<E>clear in interface List<E>clear in interface TransactionalCollection<E>public int getMaxCapacity()
protected void doAddLast(E e)
doAddLast in class AbstractTransactionalDeque<E>protected void doAddFirst(E e)
doAddFirst in class AbstractTransactionalDeque<E>public TransactionalLinkedList.Node<E> getHead()
public E removeFirst()
removeFirst in interface Deque<E>removeFirst in class AbstractTransactionalDeque<E>protected E doRemoveFirst()
doRemoveFirst in class AbstractTransactionalDeque<E>
public E takeLast()
throws InterruptedException
takeLast in interface BlockingDeque<E>takeLast in interface TransactionalDeque<E>takeLast in class AbstractTransactionalDeque<E>InterruptedException
public void putFirst(E e)
throws InterruptedException
putFirst in interface BlockingDeque<E>putFirst in interface TransactionalDeque<E>putFirst in class AbstractTransactionalDeque<E>InterruptedExceptionprotected E doRemoveLast()
doRemoveLast in class AbstractTransactionalDeque<E>public Iterator<E> iterator()
AbstractTransactionalDeque
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface BlockingDeque<E>iterator in interface Deque<E>iterator in interface List<E>iterator in interface TransactionalCollection<E>iterator in class AbstractTransactionalDeque<E>public E peekFirst()
peekFirst in interface Deque<E>public E peekLast()
peekLast in interface Deque<E>public Iterator<E> descendingIterator()
descendingIterator in interface Deque<E>
public boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>addAll in interface TransactionalList<E>public E get(int index)
get in interface List<E>get in interface TransactionalList<E>
public E set(int index,
E element)
set in interface List<E>set in interface TransactionalList<E>
public void add(int index,
E element)
add in interface List<E>add in interface TransactionalList<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in interface TransactionalCollection<E>public E remove(int index)
remove in interface List<E>remove in interface TransactionalList<E>public int indexOf(Object o)
indexOf in interface List<E>indexOf in interface TransactionalList<E>public int lastIndexOf(Object o)
lastIndexOf in interface List<E>lastIndexOf in interface TransactionalList<E>public ListIterator<E> listIterator()
listIterator in interface List<E>listIterator in interface TransactionalList<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>listIterator in interface TransactionalList<E>
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>subList in interface TransactionalList<E>public boolean remove(Object item)
remove in interface Collection<E>remove in interface BlockingDeque<E>remove in interface BlockingQueue<E>remove in interface Deque<E>remove in interface List<E>remove in interface TransactionalCollection<E>remove in class AbstractTransactionalDeque<E>public int hashCode()
hashCode in interface Collection<E>hashCode in interface List<E>hashCode in interface TransactionalCollection<E>hashCode in class Objectpublic boolean equals(Object thatObj)
equals in interface Collection<E>equals in interface List<E>equals in interface TransactionalCollection<E>equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||