Methods Summary |
---|
public boolean | add(java.lang.Object object)
addLast(object);
return true;
|
public void | add(int index, java.lang.Object object)
throw ValidationException.operationNotSupported("add");
|
private oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode | addAfter(java.lang.Object o, oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode n)
LinkedNode newNode = new LinkedNode(o, n.next, n);
newNode.previous.next = newNode;
newNode.next.previous = newNode;
size++;
return newNode;
|
public boolean | addAll(java.util.Collection collection)
throw ValidationException.operationNotSupported("addAll");
|
public boolean | addAll(int index, java.util.Collection collection)
throw ValidationException.operationNotSupported("addAll");
|
public oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode | addFirst(java.lang.Object o)Inserts the given contents at the beginning of this list.
return addAfter(o, header);
|
public oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode | addLast(java.lang.Object o)Appends the given contents to the end of this list. (Identical in
function to the add method; included only for consistency.)
return addAfter(o, header.previous);
|
public void | clear()Removes all of the contentss from this list.
header.next = header;
header.previous = header;
size = 0;
|
public boolean | contains(java.lang.Object o)Returns true if this list contains the specified contents.
More formally, returns true if and only if this list contains
at least one contents e such that (o==null ? e==null
: o.equals(e)).
return indexOf(o) != -1;
|
public boolean | containsAll(java.util.Collection collection)
throw ValidationException.operationNotSupported("containsAll");
|
public java.lang.Object | get(int index)
throw ValidationException.operationNotSupported("get");
|
public java.lang.Object | getFirst()Returns the first contents in this list.
if (size == 0) {
return null;
}
return header.next.contents;
|
public java.lang.Object | getLast()Returns the last contents in this list.
if (size == 0) {
return null;
}
return header.previous.contents;
|
public int | indexOf(java.lang.Object o)Returns the index in this list of the first occurrence of the
specified contents, or -1 if the List does not contain this
contents. More formally, returns the lowest index i such that
(o==null ? get(i)==null : o.equals(get(i))), or -1 if
there is no such index.
int index = 0;
if (o == null) {
for (LinkedNode n = header.next; n != header; n = n.next) {
if (n.contents == null) {
return index;
}
index++;
}
} else {
for (LinkedNode n = header.next; n != header; n = n.next) {
if (o.equals(n.contents)) {
return index;
}
index++;
}
}
return -1;
|
public boolean | isEmpty()
return size() == 0;
|
public java.util.Iterator | iterator()
throw ValidationException.operationNotSupported("iterator");
|
public int | lastIndexOf(java.lang.Object object)
throw ValidationException.operationNotSupported("lastIndexOf");
|
public java.util.ListIterator | listIterator(int index)
throw ValidationException.operationNotSupported("listIterator");
|
public java.util.ListIterator | listIterator()
throw ValidationException.operationNotSupported("listIterator");
|
public void | moveFirst(oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode node)Allows a node to be efficiently moved first.
if (node == header) {
throw new NoSuchElementException();
} else if ((node.previous == null) || (node.next == null)) {
// Handles case of node having already been removed.
size++;
} else {
node.previous.next = node.next;
node.next.previous = node.previous;
}
node.next = header.next;
node.previous = header;
header.next = node;
node.next.previous = node;
|
public boolean | remove(java.lang.Object object)
throw ValidationException.operationNotSupported("remove");
|
public java.lang.Object | remove(int index)
throw ValidationException.operationNotSupported("remove");
|
public void | remove(oracle.toplink.essentials.internal.helper.linkedlist.LinkedNode n)Allows a node to be efficiently removed.
if (n == header) {
throw new NoSuchElementException();
} else if ((n.previous == null) || (n.next == null)) {
// Handles case of node having already been removed.
return;
}
n.previous.next = n.next;
n.next.previous = n.previous;
// Also clear the nodes references to know that it has been removed.
n.previous = null;
n.next = null;
n.contents = null;
size--;
|
public boolean | removeAll(java.util.Collection collection)
throw ValidationException.operationNotSupported("removeAll");
|
public java.lang.Object | removeFirst()Removes and returns the first contents from this list.
if (size != 0) {
Object first = header.next.contents;
remove(header.next);
return first;
}
return null;
|
public java.lang.Object | removeLast()Removes and returns the last contents from this list.
if (size != 0) {
Object last = header.previous.contents;
remove(header.previous);
return last;
}
return null;
|
public boolean | retainAll(java.util.Collection collection)
throw ValidationException.operationNotSupported("retainAll");
|
public java.lang.Object | set(int index, java.lang.Object value)
throw ValidationException.operationNotSupported("set");
|
public int | size()Returns the number of contentss in this list.
return size;
|
public java.util.List | subList(int start, int end)
throw ValidationException.operationNotSupported("subList");
|
public java.lang.Object[] | toArray(java.lang.Object[] array)
throw ValidationException.operationNotSupported("toArray");
|
public java.lang.Object[] | toArray()
throw ValidationException.operationNotSupported("toArray");
|