|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectPIP.Collections.Persistent.AbstractCollection<E>
PIP.Collections.Persistent.AbstractList<T>
PIP.Collections.Persistent.SArrayList<T>
public class SArrayList<T>
JDO requires classes to be enhanced in order to serialise those objects. However, JDO explicitly recognises the collection classes so that they can be used as member variables without being enhanced and also so that they map cleanly to referential structures. However, this mechanism does not allow collections to be persisted in other circumstances such when they are used as values in a map or collections of collections. In order to persist use collections a first class persistence capable object I have created a new set of classes prefixed by S that mirror those contained with the Java.utils package. This has pattern has also been provided directly in other JDO implementations. Therefore, this class if an exact replication of the standard Java jdk ArrayList class
| Constructor Summary | |
|---|---|
SArrayList()
|
|
SArrayList(int n)
|
|
| Method Summary | |
|---|---|
boolean |
add(T t)
Appends the specified element to the end of this List (optional operation). |
T |
get(int index)
Returns the element at the specified position in this list. |
T |
remove(int index)
Removes the element at the specified position in this list (optional operation). |
T |
set(int index,
T element)
Replaces the element at the specified position in this list with the specified element (optional operation). |
int |
size()
Returns the number of elements in this collection. |
| Methods inherited from class PIP.Collections.Persistent.AbstractList |
|---|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList |
| Methods inherited from class PIP.Collections.Persistent.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public SArrayList()
public SArrayList(int n)
| Method Detail |
|---|
public boolean add(T t)
AbstractListThis implementation calls add(size(), o).
Note that this implementation throws an UnsupportedOperationException unless add(int, Object) is overridden.
add in interface java.util.Collection<T>add in interface java.util.List<T>add in class AbstractList<T>t - element to be appended to this list.
public T remove(int index)
AbstractListThis implementation always throws an UnsupportedOperationException.
remove in interface java.util.List<T>remove in class AbstractList<T>index - the index of the element to remove.
public T set(int index,
T element)
AbstractListThis implementation always throws an UnsupportedOperationException.
set in interface java.util.List<T>set in class AbstractList<T>index - index of element to replace.element - element to be stored at the specified position.
public int size()
AbstractCollection
size in interface java.util.Collection<T>size in interface java.util.List<T>size in class AbstractCollection<T>public T get(int index)
AbstractList
get in interface java.util.List<T>get in class AbstractList<T>index - index of element to return.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||