public class TransactionalQueue<E> extends SemiPersistent<TransactionalQueue<E>> implements Queue<E>
| Constructor and Description |
|---|
TransactionalQueue()
Creates an empty
TransactionalQueue. |
TransactionalQueue(Collection<E> sourceCollection)
Creates a new
TransactionalQueue initializing it with the given collection of elements. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
protected TransactionalQueue<E> |
cleanCopy()
Creates a new transactional entity from the current one discarding all the local changes.
|
void |
clear() |
TransactionalQueue<E> |
commit(TransactionalQueue<E> globalState)
For performance purposes returned global state is initialized with empty iterator, therefore polling data from
the collection is not possible.
|
boolean |
contains(Object o)
This operation is not supported.
|
boolean |
containsAll(Collection<?> c)
This operation is not supported.
|
protected TransactionalQueue<E> |
dirtyCopy()
Copies references to the source data along with local changes and read/write logs.
|
void |
drainTo(Collection<E> collection)
Polls all the elements from the queue and adds them to the collection.
|
E |
element() |
boolean |
isEmpty() |
Iterator<E> |
iterator()
This operation is not supported.
|
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
E |
remove() |
boolean |
remove(Object o)
This operation is not supported.
|
boolean |
removeAll(Collection<?> c)
This operation is not supported.
|
boolean |
retainAll(Collection<?> c)
This operation is not supported.
|
int |
size() |
Object[] |
toArray()
This operation is not supported.
|
<T> T[] |
toArray(T[] a)
This operation is not supported.
|
protected void |
update(TransactionalQueue<E> changes,
boolean onlyReadLogs)
Updates local changes and change logs using change logs of the arguments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCodepublic TransactionalQueue()
TransactionalQueue.public TransactionalQueue(Collection<E> sourceCollection)
TransactionalQueue initializing it with the given collection of elements.sourceCollection - The Collection of elements copy of which will be used as
TransactionalQueue initial state.protected TransactionalQueue<E> cleanCopy()
SemiPersistentcleanCopy in class SemiPersistent<TransactionalQueue<E>>protected TransactionalQueue<E> dirtyCopy()
SemiPersistentSemiPersistent#update(Object) will not work.dirtyCopy in class SemiPersistent<TransactionalQueue<E>>protected void update(TransactionalQueue<E> changes, boolean onlyReadLogs)
SemiPersistentSemiPersistent.dirtyCopy(). update in class SemiPersistent<TransactionalQueue<E>>changes - The branched collection possibly with updates.onlyReadLogs - If true only read logs are updated. Useful for read-only transactions.public TransactionalQueue<E> commit(TransactionalQueue<E> globalState)
public void drainTo(Collection<E> collection)
collection - The collection to be populated with elements from the queue.public boolean isEmpty()
isEmpty in interface Collection<E>public int size()
size in interface Collection<E>public boolean add(E e)
public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>public void clear()
clear in interface Collection<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>UnsupportedOperationException - immediately on invocation.public boolean contains(Object o)
contains in interface Collection<E>UnsupportedOperationException - immediately on invocation.public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>UnsupportedOperationException - immediately on invocation.public boolean remove(Object o)
remove in interface Collection<E>UnsupportedOperationException - immediately on invocation.public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>UnsupportedOperationException - immediately on invocation.public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>UnsupportedOperationException - immediately on invocation.public Object[] toArray()
toArray in interface Collection<E>UnsupportedOperationException - immediately on invocation.public <T> T[] toArray(T[] a)
toArray in interface Collection<E>UnsupportedOperationException - immediately on invocation.Copyright © 2013 CERN, The European Organization for Nuclear Research. All Rights Reserved.