|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--arlut.csd.Util.VecSortInsert
This class is used to do an ordered insert using a binary search.
It's designed for speed. Used in the Ganymede client to efficiently
add new items to the client's object tree. Uses the
Compare interface for ordering
comparisons.
| Field Summary | |
(package private) arlut.csd.Util.Compare |
comparator
|
(package private) static boolean |
debug
|
| Constructor Summary | |
VecSortInsert()
Constructor. |
|
VecSortInsert(arlut.csd.Util.Compare comparator)
Constructor. |
|
| Method Summary | |
int |
compare(java.lang.Object a,
java.lang.Object b)
Default comparator, does a string comparison on the toString() output of the objects for ordering. |
void |
insert(java.util.Vector objects,
java.lang.Object element)
This method does the work. |
static void |
insert(java.util.Vector objects,
java.lang.Object element,
arlut.csd.Util.Compare comparator)
This static method does the work. |
static void |
main(java.lang.String[] argv)
|
(package private) static void |
printTest(int size,
int low,
int med,
int high)
|
(package private) static void |
printTest(java.util.Vector vec)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
arlut.csd.Util.Compare comparator
static final boolean debug
| Constructor Detail |
public VecSortInsert()
Constructor. By not specifying a comparator, an ordinary string comparison will be performed on elements inserted.
public VecSortInsert(arlut.csd.Util.Compare comparator)
Constructor. If comparator is null, an ordinary string comparison will be performed on elements inserted.
| Method Detail |
public static void main(java.lang.String[] argv)
static void printTest(java.util.Vector vec)
static void printTest(int size,
int low,
int med,
int high)
public static void insert(java.util.Vector objects,
java.lang.Object element,
arlut.csd.Util.Compare comparator)
public void insert(java.util.Vector objects,
java.lang.Object element)
public int compare(java.lang.Object a,
java.lang.Object b)
Default comparator, does a string comparison on the toString() output of the objects for ordering.
compare in interface Compare
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||