|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.OzoneObject
org.ozoneDB.collections.AbstractOzoneCollection
org.ozoneDB.collections.BaseListImpl
org.ozoneDB.collections.FullLinkedListImpl
Linked list implementation of the List interface. In addition to the methods of the List interface, this class provides access to the first and last list elements in O(1) time for easy stack, queue, or double-ended queue (deque) creation. The list is doubly-linked, with traversal to a given index starting from the end closest to the element.
LinkedList is not synchronized, so if you need multi-threaded access,
consider using:
List l = Collections.synchronizedList(new LinkedList(...));
The iterators are fail-fast, meaning that any structural
modification, except for remove()
called on the iterator
itself, cause the iterator to throw a
ConcurrentModificationException
rather than exhibit
non-deterministic behavior.
List
,
ArrayList
,
Vector
,
Collections.synchronizedList(java.util.List)
,
Serialized FormField Summary |
Fields inherited from class org.ozoneDB.collections.BaseListImpl |
modCount |
Constructor Summary | |
FullLinkedListImpl()
Create an empty linked list. |
|
FullLinkedListImpl(java.util.Collection c)
Create a linked list containing the elements, in order, of a given collection. |
Method Summary | |
java.util.List |
_org_ozoneDB_emptyClientCollection()
Needed for sub lists so that they can return the same type of list as the sub lists backing list would when getClientXxx() is
called. |
int |
_org_ozoneDB_getModCount()
|
java.util.Iterator |
_org_ozoneDB_internalIterator()
|
void |
add(int index,
java.lang.Object o)
Inserts an element in the given position in the list. |
boolean |
add(java.lang.Object o)
Adds an element to the end of the list. |
boolean |
addAll(java.util.Collection c)
Append the elements of the collection in iteration order to the end of this list. |
boolean |
addAll(int index,
java.util.Collection c)
Insert the elements of the collection in iteration order at the given index of this list. |
void |
addFirst(java.lang.Object o)
Insert an element at the first of the list. |
void |
addLast(java.lang.Object o)
Insert an element at the last of the list. |
void |
clear()
Remove all elements from this list. |
java.lang.Object |
clone()
Create a shallow copy of this LinkedList (the elements are not cloned). |
boolean |
contains(java.lang.Object o)
Returns true if the list contains the given object. |
java.lang.Object |
get(int index)
Return the element at index. |
java.lang.Object |
getFirst()
Returns the first element in the list. |
java.lang.Object |
getLast()
Returns the last element in the list. |
int |
indexOf(java.lang.Object o)
Returns the first index where the element is located in the list, or -1. |
int |
lastIndexOf(java.lang.Object o)
Returns the last index where the element is located in the list, or -1. |
java.util.ListIterator |
listIterator(int index)
Obtain a ListIterator over this list, starting at a given index. |
java.lang.Object |
remove(int index)
Removes the element at the given position from the list. |
boolean |
remove(java.lang.Object o)
Removes the entry at the lowest index in the list that matches the given object, comparing by o == null ? |
java.lang.Object |
removeFirst()
Remove and return the first element in the list. |
java.lang.Object |
removeLast()
Remove and return the last element in the list. |
java.lang.Object |
set(int index,
java.lang.Object o)
Replace the element at the given location in the list. |
int |
size()
Returns the size of the list. |
java.lang.Object[] |
toArray()
Returns an array which contains the elements of the list in order. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an Array whose component type is the runtime component type of the passed-in Array. |
Methods inherited from class org.ozoneDB.collections.BaseListImpl |
_org_ozoneDB_removeRange, equals, getClientList, hashCode, internalIterator, iterator, listIterator, subList |
Methods inherited from class org.ozoneDB.collections.AbstractOzoneCollection |
containsAll, getClientCollection, isEmpty, removeAll, retainAll, toString |
Methods inherited from class org.ozoneDB.OzoneObject |
container, database, deleteRecursive, getHandle, getObjectID, handle, onActivate, onCreate, onDelete, onPassivate, requireWriteLocking, self, setContainer, toXML |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ozoneDB.collections.BaseList |
_org_ozoneDB_removeRange |
Methods inherited from interface org.ozoneDB.collections.OzoneList |
getClientList |
Methods inherited from interface org.ozoneDB.collections.OzoneCollection |
getClientCollection, removeAll, retainAll |
Methods inherited from interface java.util.Collection |
containsAll, equals, hashCode, isEmpty, iterator |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
public FullLinkedListImpl()
public FullLinkedListImpl(java.util.Collection c)
c
- the collection to populate this list from
java.lang.NullPointerException
- if c is nullMethod Detail |
public java.lang.Object getFirst()
java.util.NoSuchElementException
- if the list is emptypublic java.lang.Object getLast()
java.util.NoSuchElementException
- if the list is emptypublic java.lang.Object removeFirst()
java.util.NoSuchElementException
- if the list is emptypublic java.lang.Object removeLast()
java.util.NoSuchElementException
- if the list is emptypublic void addFirst(java.lang.Object o)
o
- the element to insertpublic void addLast(java.lang.Object o)
o
- the element to insertpublic boolean contains(java.lang.Object o)
o == null ? e = null : o.equals(e)
.
contains
in interface java.util.Collection
contains
in class AbstractOzoneCollection
o
- the element to look for
public int size()
size
in interface java.util.Collection
size
in class AbstractOzoneCollection
public boolean add(java.lang.Object o)
add
in interface OzoneCollection
add
in class BaseListImpl
o
- the entry to add
BaseListImpl.add(int, Object)
public boolean remove(java.lang.Object o)
o == null ? e = null : o.equals(e)
.
remove
in interface OzoneCollection
remove
in class AbstractOzoneCollection
o
- the object to remove
Iterator.remove()
public boolean addAll(java.util.Collection c)
addAll
in interface OzoneCollection
addAll
in class AbstractOzoneCollection
c
- the collection to append
java.lang.NullPointerException
- if c is nullAbstractOzoneCollection.add(Object)
public boolean addAll(int index, java.util.Collection c)
addAll
in interface OzoneList
addAll
in class BaseListImpl
c
- the collection to append
java.lang.NullPointerException
- if c is null
java.lang.IndexOutOfBoundsException
- if index < 0 || index > size()public void clear()
clear
in interface OzoneCollection
clear
in class BaseListImpl
BaseListImpl.remove(int)
,
BaseListImpl._org_ozoneDB_removeRange(int, int)
public java.lang.Object get(int index)
get
in interface java.util.List
index
- the place to look
java.lang.IndexOutOfBoundsException
- if index < 0 || index >= size()public java.lang.Object set(int index, java.lang.Object o)
set
in interface OzoneList
set
in class BaseListImpl
index
- which index to changeo
- the new element
java.lang.IndexOutOfBoundsException
- if index < 0 || index >= size()public void add(int index, java.lang.Object o)
add
in interface OzoneList
add
in class BaseListImpl
index
- where to insert the elemento
- the element to insert
java.lang.IndexOutOfBoundsException
- if index < 0 || index > size()public java.lang.Object remove(int index)
remove
in interface OzoneList
remove
in class BaseListImpl
index
- the location of the element to remove
java.lang.IndexOutOfBoundsException
- if index < 0 || index > size()BaseListImpl.modCount
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
indexOf
in class BaseListImpl
o
- the element to look for
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
lastIndexOf
in class BaseListImpl
o
- the element to look for
public java.util.Iterator _org_ozoneDB_internalIterator()
_org_ozoneDB_internalIterator
in interface OzoneCollection
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
listIterator
in class BaseListImpl
index
- the index of the element to be returned by the first call to
next(), or size() to be initially positioned at the end of the list
java.lang.IndexOutOfBoundsException
- if index < 0 || index > size()BaseListImpl.modCount
public java.lang.Object clone()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in class AbstractOzoneCollection
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in class AbstractOzoneCollection
a
- the passed-in Array
java.lang.ArrayStoreException
- if the runtime type of a does not allow
an element in this list
java.lang.NullPointerException
- if a is nullpublic int _org_ozoneDB_getModCount()
_org_ozoneDB_getModCount
in interface BaseList
public java.util.List _org_ozoneDB_emptyClientCollection()
BaseList
getClientXxx()
is
called.
_org_ozoneDB_emptyClientCollection
in interface BaseList
getClientXxx()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |