| java.lang.Object com.versant.core.common.SortableBase
All known Subclasses: com.versant.core.server.OIDGraph, com.versant.core.metadata.ClassReferenceGraph, com.versant.core.jdo.query.VariableSorter, com.versant.core.jdo.query.ImportSorter,
SortableBase | abstract public class SortableBase (Code) | | Base class for containers that need to be able to sort themselves using
the quicksort algorithm. Subclasses just need to implement compare
and swap to make themselves sortable. The size field must be set to
the number of entries in the container when sort is called.
See Also: SortableBase.compare See Also: SortableBase.swap See Also: SortableBase.sort See Also: SortableBase.size |
Field Summary | |
protected int | size The number of entries in the container. |
Method Summary | |
abstract protected int | compare(int a, int b) Compare entries at and a and b. | public void | sort() Sort the entries. | public void | sort(int min, int max) | abstract protected void | swap(int index1, int index2) Swap entries. |
size | protected int size(Code) | | The number of entries in the container.
|
compare | abstract protected int compare(int a, int b)(Code) | | Compare entries at and a and b. Return 0 if equal, less than 0
if a is less than b or greater than 0 if a is greater than b.
|
sort | public void sort()(Code) | | Sort the entries.
|
sort | public void sort(int min, int max)(Code) | | |
swap | abstract protected void swap(int index1, int index2)(Code) | | Swap entries.
|
|
|