Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.lang
Interface Comparable

All Known Implementing Classes:
BaseDate, BaseTime, BigDecimal, BigInteger, ComparableBoolean, ComparableByte, ComparableCharacter, ComparableDate, ComparableDouble, ComparableFloat, ComparableInteger, ComparableLong, ComparableShort, ComparableString, Date, DBSequence, File, Number, Number, Time, Timestamp, Timestamp

public interface Comparable

This interface should be implemented by all classes which wish to define a natural ordering of their instances. The ordering rule must be transitive and invertible (i.e. the sign of the result of x.compareTo(y) must equal the negation of the sign of the result of y.compareTo(x) for all x and y).

In addition, it is desirable (but not required) that when the result of x.compareTo(y) is zero (and only then) the result of x.equals(y) should be true.


Method Summary
 int compareTo(java.lang.Object another)
          Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.
 

Method Detail

compareTo

int compareTo(java.lang.Object another)
Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.

Parameters:
another - Object an object to compare the receiver to
Returns:
int which should be <0 if the receiver should sort before the argument, 0 if the receiver should sort in the same position as the argument, and >0 if the receiver should sort after the argument.
Throws:
java.lang.ClassCastException - if the argument can not be converted into something comparable with the receiver.

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.