public class SortedVector extends Vector
Sortable,
Todo: Remove duplicate code for the binary search,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
(package private) CompareInterface |
cmp
Deprecated.
|
(package private) CompareInterface |
sortcmp
Deprecated.
|
(package private) CompareInterface |
stringcmp
Deprecated.
|
capacityIncrement, elementCount, elementDatamodCount| Constructor and Description |
|---|
SortedVector()
Deprecated.
Create a SortedVector
|
SortedVector(CompareInterface cmp)
Deprecated.
Create a SortedVector, specifying which compare function to use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBinSorted(Object newObject)
Deprecated.
Store an object in its right location, search for the location
the binary (smart) way.
|
void |
addLinSorted(Object newObject)
Deprecated.
Store an object in its right location, search for the location
the linear (stupid) way.
|
void |
addSorted(Object newObject)
Deprecated.
Store an object in its right location.
|
void |
addSorted(Sortable newObject)
Deprecated.
Store an object in its right location.
|
void |
addUniqueSorted(Object newObject)
Deprecated.
Store an object in its right location, search for the location
the binary (smart) way and only insert it if it's not in the Vector yet.
|
int |
find(Object newObject)
Deprecated.
Find an object in the SortedVector.
|
boolean |
has(Object newObject)
Deprecated.
See if an object is in the SortedVector
This should be contains(Object) but that one is final.
|
static void |
main(String[] args)
Deprecated.
Test the class
|
void |
setCompare(CompareInterface cmp)
Deprecated.
Change the compare function the SortedVector should use.
|
void |
Sort()
Deprecated.
Sort the SortedVector
|
static SortedVector |
SortVector(List<String> vec)
Deprecated.
Sort a Vector and return a SortedVector.
|
static SortedVector |
SortVector(List vec,
CompareInterface cmpI)
Deprecated.
Sort a Vector and return a SortedVector using the specified compare
function.
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, streamCompareInterface cmp
CompareInterface sortcmp
CompareInterface stringcmp
public SortedVector()
public SortedVector(CompareInterface cmp)
CompareInterfacepublic void addSorted(Object newObject)
public void addSorted(Sortable newObject)
public void addUniqueSorted(Object newObject)
public void addLinSorted(Object newObject)
public void addBinSorted(Object newObject)
public boolean has(Object newObject)
Vectorpublic int find(Object newObject)
Vectorpublic void setCompare(CompareInterface cmp)
public void Sort()
public static SortedVector SortVector(List<String> vec)
public static SortedVector SortVector(List vec, CompareInterface cmpI)
public static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}