|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlparser.util.sort.Sort
public class Sort
A quick sort algorithm to sort Vectors or arrays. Provides sort and binary search capabilities.
This all goes away in JDK 1.2.
Method Summary | |
---|---|
static int |
bsearch(Ordered[] array,
Ordered ref)
Binary search for an object |
static int |
bsearch(Ordered[] array,
Ordered ref,
int lo,
int hi)
Binary search for an object |
static int |
bsearch(Sortable set,
Ordered ref)
Binary search for an object |
static int |
bsearch(Sortable set,
Ordered ref,
int lo,
int hi)
Binary search for an object |
static int |
bsearch(Vector vector,
Ordered ref)
Binary search for an object |
static int |
bsearch(Vector vector,
Ordered ref,
int lo,
int hi)
Binary search for an object |
static Object[] |
QuickSort(Hashtable h)
Sort a Hashtable. |
static void |
QuickSort(Ordered[] a)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(Ordered[] a,
int lo0,
int hi0)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(Sortable sortable)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(Sortable sortable,
int lo0,
int hi0)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(String[] a)
This is a string version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(String[] a,
int lo0,
int hi0)
This is a string version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(Vector v)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
QuickSort(Vector v,
int lo0,
int hi0)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void QuickSort(Vector v) throws ClassCastException
QuickSort (v, 0, v.size () - 1);
v
- A Vector
of Ordered
items.
ClassCastException
- If the vector contains objects that
are not Ordered
.public static void QuickSort(Vector v, int lo0, int hi0) throws ClassCastException
If you think of a one dimensional vector as going from the lowest index on the left to the highest index on the right then the parameters to this function are lowest index or left and highest index or right.
v
- A Vector
of Ordered
items.lo0
- Left boundary of vector partition.hi0
- Right boundary of vector partition.
ClassCastException
- If the vector contains objects that
are not Ordered
.public static void QuickSort(Ordered[] a)
Equivalent to:
QuickSort (a, 0, a.length - 1);
a
- An array of Ordered
items.public static void QuickSort(Ordered[] a, int lo0, int hi0)
If you think of a one dimensional array as going from the lowest index on the left to the highest index on the right then the parameters to this function are lowest index or left and highest index or right.
a
- An array of Ordered
items.lo0
- Left boundary of array partition.hi0
- Right boundary of array partition.public static void QuickSort(String[] a)
Equivalent to:
QuickSort (a, 0, a.length - 1);
a
- An array of String
items.public static void QuickSort(String[] a, int lo0, int hi0)
If you think of a one dimensional array as going from the lowest index on the left to the highest index on the right then the parameters to this function are lowest index or left and highest index or right.
a
- An array of String
items.lo0
- Left boundary of array partition.hi0
- Right boundary of array partition.public static void QuickSort(Sortable sortable, int lo0, int hi0)
sortable
- A Sortable
object.lo0
- Left boundary of partition.hi0
- Right boundary of partition.public static void QuickSort(Sortable sortable)
Equivalent to:
QuickSort (sortable, sortable.first (), sortable.last ());
sortable
- A Sortable
object.public static Object[] QuickSort(Hashtable h) throws ClassCastException
h
- A Hashtable with String or Ordered keys.
ClassCastException
- If the keys of the hashtable
are not Ordered
.public static int bsearch(Sortable set, Ordered ref, int lo, int hi)
set
- The collection of Ordered
objects.ref
- The name to search for.lo
- The lower index within which to look.hi
- The upper index within which to look.
public static int bsearch(Sortable set, Ordered ref)
set
- The collection of Ordered
objects.ref
- The name to search for.
public static int bsearch(Vector vector, Ordered ref, int lo, int hi)
vector
- The vector of Ordered
objects.ref
- The name to search for.lo
- The lower index within which to look.hi
- The upper index within which to look.
public static int bsearch(Vector vector, Ordered ref)
vector
- The vector of Ordered
objects.ref
- The name to search for.
public static int bsearch(Ordered[] array, Ordered ref, int lo, int hi)
array
- The array of Ordered
objects.ref
- The name to search for.lo
- The lower index within which to look.hi
- The upper index within which to look.
public static int bsearch(Ordered[] array, Ordered ref)
array
- The array of Ordered
objects.ref
- The name to search for.
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |