public class ThreadCursoredList extends Vector
Modifier and Type | Field and Description |
---|---|
protected RuntimeException |
exception
Used to throw exception that occur from the concurrent population thread.
|
protected boolean |
isComplete
Store if the list is fully populated.
|
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
ThreadCursoredList()
Construct an empty list so that its internal data array
has size 10 and its standard capacity increment is zero.
|
ThreadCursoredList(int initialCapacity)
Construct an empty list with the specified initial capacity and
with its capacity increment equal to zero.
|
ThreadCursoredList(int initialCapacity,
int capacityIncrement)
Construct an empty list with the specified initial capacity and
capacity increment.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object element)
Add and notify any waiters that there are new elements.
|
boolean |
add(Object element)
Add and notify any waiters that there are new elements.
|
boolean |
addAll(Collection collection)
Add and notify any waiters that there are new elements.
|
boolean |
addAll(int index,
Collection collection)
Add and notify any waiters that there are new elements.
|
void |
addElement(Object object)
Add and notify any waiters that there are new elements.
|
void |
clear()
First wait until complete.
|
Object |
clone()
First wait until complete.
|
boolean |
contains(Object element)
If it does not contain the object must wait until it is complete.
|
boolean |
containsAll(Collection collection)
If it does not contain the object must wait until it is complete.
|
void |
copyInto(Object[] array)
First wait until complete.
|
Object |
elementAt(int index)
If the index is beyond the size wait until complete.
|
Enumeration |
elements()
Allow concurrent streaming of the elements.
|
boolean |
equals(Object object)
First wait until complete.
|
Object |
firstElement()
Wait until has an element or is complete.
|
Object |
get(int index)
Wait until has the element or is complete.
|
RuntimeException |
getException()
Return any exception that was throw from concurrent population thread.
|
protected int |
getSize() |
boolean |
hasException()
Return if any exception that was throw from concurrent population thread.
|
int |
hashCode()
First wait until complete.
|
int |
indexOf(Object element)
If does not contain the object wait until complete.
|
int |
indexOf(Object element,
int index)
If does not contain the object wait until complete.
|
void |
insertElementAt(Object element,
int index)
Add the element a notify any waiters that there are new elements.
|
boolean |
isComplete()
Return if the list is complete.
|
boolean |
isEmpty()
If empty wait until an element has been added or is complete.
|
Iterator |
iterator()
Not supported currently.
|
Object |
lastElement()
First wait until complete.
|
int |
lastIndexOf(Object element)
First wait until complete.
|
int |
lastIndexOf(Object element,
int index)
First wait until complete.
|
ListIterator |
listIterator()
Not supported currently.
|
ListIterator |
listIterator(int index)
Not supported currently.
|
Object |
remove(int index)
If index is missing wait until is there.
|
boolean |
remove(Object element)
If object is missing wait until complete.
|
boolean |
removeAll(Collection collection)
First wait until complete.
|
void |
removeAllElements()
First wait until complete.
|
boolean |
removeElement(Object element)
If missing wait until complete.
|
void |
removeElementAt(int index)
If index is missing wait until reasched or complete.
|
boolean |
retainAll(Collection collection)
First wait until complete.
|
Object |
set(int index,
Object element)
If index is missing wait until reached or complete.
|
void |
setElementAt(Object element,
int index)
If index is missing wait until reached or complete.
|
void |
setIsComplete(boolean isComplete)
Set the list complete and notify any waiters.
|
int |
size()
First wait until complete.
|
List |
subList(int fromIndex,
int toIndex)
If index is missing wait until reached or complete.
|
void |
throwException(RuntimeException exception)
Record that the population thread hit an exception,
that should be thrown to the processing thread on the next access.
|
Object[] |
toArray()
First wait until complete.
|
Object[] |
toArray(Object[] array)
First wait until complete.
|
String |
toString()
First wait until complete.
|
void |
trimToSize()
First wait until complete.
|
void |
waitUntilAdd()
Wait until a new element has been added.
|
void |
waitUntilComplete()
Wait until the list has been fully populated.
|
capacity, ensureCapacity, forEach, removeIf, removeRange, replaceAll, setSize, sort, spliterator
finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, stream
protected boolean isComplete
protected RuntimeException exception
public ThreadCursoredList()
public ThreadCursoredList(int initialCapacity)
public ThreadCursoredList(int initialCapacity, int capacityIncrement)
public void add(int index, Object element)
public boolean add(Object element)
public boolean addAll(int index, Collection collection)
public boolean addAll(Collection collection)
public void addElement(Object object)
addElement
in class Vector
public void clear()
public boolean hasException()
public RuntimeException getException()
public void throwException(RuntimeException exception)
public boolean isComplete()
public void setIsComplete(boolean isComplete)
public void waitUntilComplete()
public void waitUntilAdd()
public boolean contains(Object element)
public boolean containsAll(Collection collection)
containsAll
in interface Collection
containsAll
in interface List
containsAll
in class Vector
public void copyInto(Object[] array)
public Object elementAt(int index)
protected int getSize()
public Enumeration elements()
public boolean equals(Object object)
public Object firstElement()
firstElement
in class Vector
public Object get(int index)
public int hashCode()
public int indexOf(Object element)
public int indexOf(Object element, int index)
public void insertElementAt(Object element, int index)
insertElementAt
in class Vector
public boolean isEmpty()
public Iterator iterator()
public Object lastElement()
lastElement
in class Vector
public int lastIndexOf(Object element)
lastIndexOf
in interface List
lastIndexOf
in class Vector
public int lastIndexOf(Object element, int index)
lastIndexOf
in class Vector
public ListIterator listIterator()
listIterator
in interface List
listIterator
in class Vector
public ListIterator listIterator(int index)
listIterator
in interface List
listIterator
in class Vector
public Object remove(int index)
public boolean remove(Object element)
public boolean removeAll(Collection collection)
public void removeAllElements()
removeAllElements
in class Vector
public boolean removeElement(Object element)
removeElement
in class Vector
public void removeElementAt(int index)
removeElementAt
in class Vector
public boolean retainAll(Collection collection)
public Object set(int index, Object element)
public void setElementAt(Object element, int index)
setElementAt
in class Vector
public int size()
public List subList(int fromIndex, int toIndex)
public Object[] toArray()
public void trimToSize()
trimToSize
in class Vector
Copyright © 2022. All rights reserved.