|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
mckay.utilities.vectorsorter.SortableVector<E>
public class SortableVector<E>
A Vector that includes a generalized implementation of the Quicksort algorithm. A SortableVector will sort its own contents when its sort method is called.
An implementation of the QuicksortComparator interface is needed in order to determine on what basis the vector is to be sorted. This QuicksortComparator implementation is passed to the SortableVector during construction.
The StringSortableVector class in this package provides an example of how the this SortableVector class can be used in practice.
This approach to the Quicksort algorithm is derived from Bruce Eckel's implementation, which can be found at: http://www.codeguru.com/java/tij/tij0091.shtml
Field Summary |
---|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
SortableVector(QuicksortComparator comparator)
Stores the given QuicksortComparator object that will compare the elements during ordering. |
Method Summary | |
---|---|
void |
sort()
Iniates sorting of this Vector using the Quicksort algorithm. |
Methods inherited from class java.util.Vector |
---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Constructor Detail |
---|
public SortableVector(QuicksortComparator comparator)
comparator
- Will evaluate relative values of elements during
sorting.Method Detail |
---|
public void sort()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |