01 
02 /*
03  *  JScripter Emulation 1.0 - To Script Java
04  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
05  *  
06  *  This program is free software: you can redistribute it and/or modify
07  *  it under the terms of the GNU Affero General Public License as published by
08  *  the Free Software Foundation, either version 3 of the License, or
09  *  (at your option) any later version.
10  *  
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU Affero General Public License for more details.
15  *  
16  *  You should have received a copy of the GNU Affero General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 package org.jscripter.emu.java.lang;
21 
22 /**
23  * <p><b>Internally</b> imposes a total ordering on the objects of each class that implements 
24  * it, emulating a standard <tt>java.lang</tt> interface or class with the same simple name as this one.
25  * This ordering is referred to as the class's <i>natural ordering</i>, and the class's {@link #compareTo(Object)} 
26  * method is referred to as its <i>natural comparison method</i>.</p>
27  * <p>This interface or class is only used internally by JS re-compiler implementations.</p>
28  * <p>Please refer to <a href="http://java.sun.com/docs/">the Java API Standards</a> for detail description of the original class or interface.</p>
29  * 
30  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
31  * 
32  * @javascript Re-compilers must redirect the resolution of the emulated original Java class or interface to this one.
33  */
34 public interface Comparable<T>
35 {
36     /**
37      * <p>Compares this object with the specified object for order.</p>
38      * @param o A object to be compared.
39      * @return A negative integer, zero, or a positive integer as this object is less than, 
40      * equal to, or greater than the specified object.
41      * @throws java.io.ClassCastException if the specified object's type prevents it from 
42      * being compared to this object.
43      * @since 1.0
44      * @javascript Re-compilers must report error on end-users directly using this method.
45      */
46     int compareTo(T o);
47 }