|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.garret.consus.Persistent
org.garret.consus.POCollection
org.garret.consus.POList
org.garret.consus.POSortedList
Objects inserted into this list should implement the Comparable interface and be derived from the Persistent class. Alternatively you can specify the Comparator in the constructor. Nulls cannot be placed in the sorted list.
Field Summary |
---|
Fields inherited from class org.garret.consus.Persistent |
---|
db, oid, PO_DELETED, PO_LOADED, PO_NEW, PO_STUB, state, type |
Constructor Summary | |
---|---|
POSortedList()
Constructs an empty list. |
|
POSortedList(java.util.Collection c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collections iterator. |
|
POSortedList(int initialCapacity)
Constructs an empty list with the specified initial capacity. |
|
POSortedList(int initialCapacity,
POComparator c)
Constructs an empty list with the specified initial capacity. |
|
POSortedList(POComparator c)
Constructs an empty list and associates a comparator with the list. |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
Appends the specified element to the end of this list. |
boolean |
addAll(java.util.Collection c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collections Iterator. |
int |
compareTo(java.lang.Object o)
Compare two sorted lists |
int |
compareTo(POSortedList anotherList)
Compare two ordered lists. |
int |
findInsertPosition(java.lang.Object elem)
Find the position where the element should be inserted into the list using the compare method of Comparator or the compareTo method of the elements. |
int |
indexOf(java.lang.Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method. |
int |
lastIndexOf(java.lang.Object elem)
Returns the index of the last occurrence of the specified object in this list. |
Methods inherited from class org.garret.consus.POList |
---|
add, addAll, clear, clone, contains, ensureCapacity, get, isEmpty, iterator, listIterator, listIterator, loadClosure, remove, removeRange, set, size, subList, toArray, toArray, trimToSize |
Methods inherited from class org.garret.consus.POCollection |
---|
containsAll, equals, hashCode, remove, removeAll, retainAll, toString |
Methods inherited from class org.garret.consus.Persistent |
---|
assignOID, become, beginUpdate, endUpdate, get, get, getOid, getOid, getRef, getRef, isDeleted, isLoaded, isNew, load, loadComponents, lock, remove, save, store, store, unget |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, remove, removeAll, retainAll |
Constructor Detail |
---|
public POSortedList()
public POSortedList(java.util.Collection c)
public POSortedList(int initialCapacity)
initialCapacity
- the initial capacity of the list.public POSortedList(int initialCapacity, POComparator c)
initialCapacity
- the initial capacity of the list.c
- the comparator to be associated with the listpublic POSortedList(POComparator c)
Method Detail |
---|
public boolean add(java.lang.Object o)
add
in interface java.util.List
add
in class POList
o
- element to be appended to this list.
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.List
addAll
in class POList
c
- elements to be inserted into this list.
java.lang.IndexOutOfBoundsException
- if index out of range (index
< 0 || index > size()).POCollection.add(Object)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int compareTo(POSortedList anotherList)
compareTo
returns the difference of the lengths of the
lists -- that is, the value:
this.length()-anotherList.length()
anotherList
- the POSortedList
to be compared.
0
if all elements in the first list are equal to
the elements in the corresponding position in the second list and that the lists have the
same size; a value less than 0
is returned if the first element is not equal to
the corresponding element in the second list, is smaller than the element from the
second list or there is not such index position in the second list; a value
greater than zero is returned otherwise.
java.lang.NullPointerException
- if anotherList
is null
.public int findInsertPosition(java.lang.Object elem)
elem
- an object.
Object.equals(Object)
public int indexOf(java.lang.Object elem)
indexOf
in interface java.util.List
indexOf
in class POList
elem
- an object.
Object.equals(Object)
public int lastIndexOf(java.lang.Object elem)
lastIndexOf
in interface java.util.List
lastIndexOf
in class POList
elem
- the desired element.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |