01: package net.sf.saxon.sort;
02:
03: /**
04: * A Sortable is an object that can be sorted using the QuickSort method.
05: *
06: * @author Michael H. Kay
07: *
08: */
09:
10: public interface Sortable {
11:
12: /**
13: * Compare two objects within this Sortable, identified by their position.
14: * @return <0 if obj[a]<obj[b], 0 if obj[a]=obj[b], >0 if obj[a]>obj[b]
15: */
16:
17: public int compare(int a, int b);
18:
19: /**
20: * Swap two objects within this Sortable, identified by their position.
21: */
22:
23: public void swap(int a, int b);
24:
25: }
26:
27: //
28: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
29: // you may not use this file except in compliance with the License. You may obtain a copy of the
30: // License at http://www.mozilla.org/MPL/
31: //
32: // Software distributed under the License is distributed on an "AS IS" basis,
33: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
34: // See the License for the specific language governing rights and limitations under the License.
35: //
36: // The Original Code is: all this file.
37: //
38: // The Initial Developer of the Original Code is Michael H. Kay
39: //
40: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
41: //
42: // Contributor(s): none
43: //
|