KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > sort > Sortable


1 package net.sf.saxon.sort;
2
3
4
5 /**
6  * A Sortable is an object that can be sorted using the QuickSort method.
7  *
8  * @author Michael H. Kay
9  *
10  */

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

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

24
25     public void swap(int a, int b);
26
27 }
28
29
30 //
31
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
32
// you may not use this file except in compliance with the License. You may obtain a copy of the
33
// License at http://www.mozilla.org/MPL/
34
//
35
// Software distributed under the License is distributed on an "AS IS" basis,
36
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
37
// See the License for the specific language governing rights and limitations under the License.
38
//
39
// The Original Code is: all this file.
40
//
41
// The Initial Developer of the Original Code is Michael H. Kay
42
//
43
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
44
//
45
// Contributor(s): none
46
//
Popular Tags