com.caucho.util
Interface ComparableElement<E>

All Superinterfaces:
java.lang.Comparable<E>
All Known Subinterfaces:
TimeInterval
All Known Implementing Classes:
TimeIntervalElement

public interface ComparableElement<E>
extends java.lang.Comparable<E>

Defines an interface to that an object can provide a comparison of itself to others of its type, with the comparison returned as an object.


Nested Class Summary
static interface ComparableElement.Comparison<E>
          A comparison of the typed element.
 
Method Summary
 int compareTo(E element)
          The recommended implementation of this method is: public int compareTo(E element) { return comparison(element).value(); }
 ComparableElement.Comparison<E> compareWith(E element)
          Returns a result that provides a ComparableElement.Comparison of this element with that of the element parameter.
 

Method Detail

compareWith

ComparableElement.Comparison<E> compareWith(E element)
Returns a result that provides a ComparableElement.Comparison of this element with that of the element parameter.

Parameters:
element - to be compared with.
Returns:
the Comparison

compareTo

int compareTo(E element)
The recommended implementation of this method is: public int compareTo(E element) { return comparison(element).value(); }

Specified by:
compareTo in interface java.lang.Comparable<E>