KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > sort > Sortable


1 package com.icl.saxon.sort;
2
3
4 /**
5  * A Sortable is an object that can be sorted using the QuickSort method.
6  *
7  * @author Michael H. Kay (mhkay@iclway.co.uk)
8  *
9  */

10
11 public interface Sortable {
12
13     /**
14     * Compare two objects within this Sortable, identified by their position.
15     * @return <0 if obj[a]<obj[b], 0 if obj[a]=obj[b], >0 if obj[a]>obj[b]
16     */

17
18     public int compare(int a, int b);
19
20     /**
21     * Swap two objects within this Sortable, identified by their position.
22     */

23
24     public void swap(int a, int b);
25
26 }
27
Popular Tags