Methods Summary |
---|
public synchronized void | add(int index, java.lang.Object element)Add and notify any waiters that there are new elements.
super.add(index, element);
this.notifyAll();
|
public synchronized boolean | add(java.lang.Object element)Add and notify any waiters that there are new elements.
boolean result = super.add(element);
notifyAll();
return result;
|
public synchronized boolean | addAll(int index, java.util.Collection collection)Add and notify any waiters that there are new elements.
boolean result = super.addAll(index, collection);
notifyAll();
return result;
|
public synchronized boolean | addAll(java.util.Collection collection)Add and notify any waiters that there are new elements.
boolean result = super.addAll(collection);
notifyAll();
return result;
|
public synchronized void | addElement(java.lang.Object object)Add and notify any waiters that there are new elements.
super.addElement(object);
notifyAll();
|
public synchronized void | clear()First wait until complete.
waitUntilComplete();
super.clear();
|
public synchronized java.lang.Object | clone()First wait until complete.
waitUntilComplete();
return super.clone();
|
public synchronized boolean | contains(java.lang.Object element)If it does not contain the object must wait until it is complete.
boolean result = super.contains(element);
if ((result != true) && (!isComplete())) {
waitUntilComplete();
result = super.contains(element);
}
return result;
|
public synchronized boolean | containsAll(java.util.Collection collection)If it does not contain the object must wait until it is complete.
boolean result = super.containsAll(collection);
if ((result != true) && (!isComplete())) {
waitUntilComplete();
result = super.containsAll(collection);
}
return result;
|
public synchronized void | copyInto(java.lang.Object[] array)First wait until complete.
waitUntilComplete();
super.copyInto(array);
|
public synchronized java.lang.Object | elementAt(int index)If the index is beyond the size wait until complete.
Object result = super.elementAt(index);
if ((result == null) && (!isComplete())) {
waitUntilComplete();
result = super.elementAt(index);
}
return result;
|
public java.util.Enumeration | elements()Allow concurrent streaming of the elements.
return new Enumeration() {
int count = 0;
public boolean hasMoreElements() {
synchronized (ThreadCursoredList.this) {
boolean result = count < ThreadCursoredList.this.getSize();
while ((!result) && (!isComplete())) {
waitUntilAdd();
result = count < ThreadCursoredList.this.getSize();
}
return result;
}
}
public Object nextElement() {
synchronized (ThreadCursoredList.this) {
boolean result = count < ThreadCursoredList.this.getSize();
while ((!result) && (!isComplete())) {
waitUntilAdd();
result = count < ThreadCursoredList.this.getSize();
}
if (result) {
return get(count++);
}
}
throw new NoSuchElementException("Vector Enumeration");
}
};
|
public synchronized boolean | equals(java.lang.Object object)First wait until complete.
waitUntilComplete();
return super.equals(object);
|
public synchronized java.lang.Object | firstElement()Wait until has an element or is complete.
while ((!isComplete()) && (super.size() < 1)) {
waitUntilAdd();
}
return super.firstElement();
|
public synchronized java.lang.Object | get(int index)Wait until has the element or is complete.
while ((!isComplete()) && (super.size() < index)) {
waitUntilAdd();
}
return super.get(index);
|
public java.lang.RuntimeException | getException()Return any exception that was throw from concurrent population thread.
return exception;
|
protected int | getSize()
return super.size();
|
public boolean | hasException()Return if any exception that was throw from concurrent population thread.
return getException() != null;
|
public synchronized int | hashCode()First wait until complete.
waitUntilComplete();
return super.hashCode();
|
public int | indexOf(java.lang.Object element)If does not contain the object wait until complete.
int result = super.indexOf(element);
if ((result == -1) && (!isComplete())) {
waitUntilComplete();
result = super.indexOf(element);
}
return result;
|
public synchronized int | indexOf(java.lang.Object element, int index)If does not contain the object wait until complete.
int result = super.indexOf(element, index);
if ((result == -1) && (!isComplete())) {
waitUntilComplete();
result = super.indexOf(element, index);
}
return result;
|
public synchronized void | insertElementAt(java.lang.Object element, int index)Add the element a notify any waiters that there are new elements.
super.insertElementAt(element, index);
notify();
|
public synchronized boolean | isComplete()Return if the list is complete.
If an exception was thrown during the concurrent population throw the exception.
if (hasException()) {
// Set the exception to null so it is only thrown once.
RuntimeException thrownException = this.exception;
this.exception = null;
throw thrownException;
}
return isComplete;
|
public boolean | isEmpty()If empty wait until an element has been added or is complete.
boolean result = super.isEmpty();
if (result && (!isComplete())) {
waitUntilAdd();
result = super.isEmpty();
}
return result;
|
public java.util.Iterator | iterator()Not supported currently.
throw ValidationException.operationNotSupported("iterator");
|
public synchronized java.lang.Object | lastElement()First wait until complete.
waitUntilComplete();
return super.lastElement();
|
public int | lastIndexOf(java.lang.Object element)First wait until complete.
waitUntilComplete();
return super.lastIndexOf(element);
|
public synchronized int | lastIndexOf(java.lang.Object element, int index)First wait until complete.
waitUntilComplete();
return super.lastIndexOf(element, index);
|
public java.util.ListIterator | listIterator()Not supported currently.
throw ValidationException.operationNotSupported("iterator");
|
public java.util.ListIterator | listIterator(int index)Not supported currently.
throw ValidationException.operationNotSupported("iterator");
|
public synchronized java.lang.Object | remove(int index)If index is missing wait until is there.
while ((!isComplete()) && (super.size() < index)) {
waitUntilAdd();
}
return super.remove(index);
|
public boolean | remove(java.lang.Object element)If object is missing wait until complete.
boolean result = super.remove(element);
if ((!result) && (!isComplete())) {
waitUntilAdd();
result = super.remove(element);
}
return result;
|
public synchronized boolean | removeAll(java.util.Collection collection)First wait until complete.
waitUntilComplete();
return super.removeAll(collection);
|
public synchronized void | removeAllElements()First wait until complete.
waitUntilComplete();
super.removeAllElements();
|
public synchronized boolean | removeElement(java.lang.Object element)If missing wait until complete.
boolean result = super.removeElement(element);
if ((!result) && (!isComplete())) {
waitUntilAdd();
result = super.removeElement(element);
}
return result;
|
public synchronized void | removeElementAt(int index)If index is missing wait until reasched or complete.
while ((!isComplete()) && (super.size() < index)) {
waitUntilAdd();
}
super.removeElementAt(index);
|
public synchronized boolean | retainAll(java.util.Collection collection)First wait until complete.
waitUntilComplete();
return super.retainAll(collection);
|
public synchronized java.lang.Object | set(int index, java.lang.Object element)If index is missing wait until reached or complete.
while ((!isComplete()) && (super.size() < index)) {
waitUntilAdd();
}
return super.set(index, element);
|
public synchronized void | setElementAt(java.lang.Object element, int index)If index is missing wait until reached or complete.
while ((!isComplete()) && (super.size() < index)) {
waitUntilAdd();
}
super.setElementAt(element, index);
|
public synchronized void | setIsComplete(boolean isComplete)Set the list complete and notify any waiters.
this.isComplete = isComplete;
notifyAll();
|
public int | size()First wait until complete.
waitUntilComplete();
return super.size();
|
public java.util.List | subList(int fromIndex, int toIndex)If index is missing wait until reached or complete.
while ((!isComplete()) && (super.size() < toIndex)) {
waitUntilAdd();
}
return super.subList(fromIndex, toIndex);
|
public synchronized void | throwException(java.lang.RuntimeException exception)Record that the population thread hit an exception,
that should be thrown to the processing thread on the next access.
This also records the list and complete.
this.exception = exception;
setIsComplete(true);
|
public synchronized java.lang.Object[] | toArray()First wait until complete.
waitUntilComplete();
return super.toArray();
|
public synchronized java.lang.Object[] | toArray(java.lang.Object[] array)First wait until complete.
waitUntilComplete();
return super.toArray(array);
|
public synchronized java.lang.String | toString()First wait until complete.
waitUntilComplete();
return super.toString();
|
public synchronized void | trimToSize()First wait until complete.
waitUntilComplete();
super.trimToSize();
|
public synchronized void | waitUntilAdd()Wait until a new element has been added.
try {
wait();
} catch (InterruptedException ignore) {
}
|
public synchronized void | waitUntilComplete()Wait until the list has been fully populated.
while (!isComplete()) {
try {
wait();
} catch (InterruptedException ignore) {
}
}
|