aicas logo Jamaica 3.4 release 8

java.lang
Interface Comparable<T>

All Known Subinterfaces:
Delayed, Name, RunnableScheduledFuture<V>, ScheduledFuture<V>
All Known Implementing Classes:
AbsoluteTime, BigDecimal, BigInteger, Boolean, Byte, ByteBuffer, Calendar, Character, CharBuffer, Charset, CollationKey, Component.BaselineResizeBehavior, CompositeName, CompoundName, Date, Date, Desktop.Action, Double, DoubleBuffer, ElementType, Enum, File, Float, FloatBuffer, FormattedFloatingDecimal.Form, Formatter.BigDecimalLayoutForm, GregorianCalendar, HighResolutionTime, IntBuffer, Integer, LdapName, LdapName, Long, LongBuffer, MappedByteBuffer, MemoryType, Normalizer.Form, ObjectStreamField, RationalTime, Rdn, RelativeTime, RetentionPolicy, RoundingMode, Short, ShortBuffer, String, Thread.State, Time, Timestamp, TimeUnit, URI, UUID

public interface Comparable<T>

Comparable is a feature of classes that define a full order.

Since:
1.2

Method Summary
 int compareTo(T o)
          compareTo compares this to another object.
 

Method Detail

compareTo

int compareTo(T o)
compareTo compares this to another object.

for any a, b and c that are comparable instance of the same class, the following must hold:

a.compareTo(b) < 0 ==> b.compareTo(a) > 0 a.compareTo(b) > 0 ==> b.compareTo(a) < 0 a.compareTo(b) == 0 ==> b.compareTo(a) == 0

a.compareTo(b) == 0 && a.compareTo(c) < 0 ==> b.compareTo(c) < 0 a.compareTo(b) == 0 && a.compareTo(c) > 0 ==> b.compareTo(c) > 0 a.compareTo(b) == 0 && a.compareTo(c) == 0 ==> b.compareTo(c) == 0

a.compareTo(b) < 0 && b.compareTo(c) < 0 ==> a.compareTo(c) < 0 a.compareTo(b) > 0 && b.compareTo(c) > 0 ==> a.compareTo(c) > 0

Parameters:
o - the other object
Returns:
a value <0 if this < o, 0 if this == o and a value > 0 if this > o.
Throws:
ClassCastException - may be thrown if o is not of the same class as this.
Since:
1.2

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.