jpos.util
Class DefaultComparableElement

java.lang.Object
  |
  +--jpos.util.DefaultComparableElement
All Implemented Interfaces:
Comparable

public class DefaultComparableElement
extends java.lang.Object
implements Comparable

Default implementation of the Comparable interface NOTE: uses the Object's toString() method as the mean of comparison

Version:
1.2.0 (JDK 1.1.x)
Author:
E. Michael Maximilien (maxim@us.ibm.com)

Constructor Summary
DefaultComparableElement(java.lang.Object obj)
          Default 1-argument ctor
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this and other arguments for order
 boolean equals(java.lang.Object other)
          Indicates this object is "equal to" the other
 java.lang.Object getObject()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultComparableElement

public DefaultComparableElement(java.lang.Object obj)
Default 1-argument ctor
Parameters:
obj - the element's Object
Method Detail

compareTo

public int compareTo(java.lang.Object other)
Compares this and other arguments for order
Specified by:
compareTo in interface Comparable
Parameters:
other - object to compare to

equals

public boolean equals(java.lang.Object other)
Indicates this object is "equal to" the other
Specified by:
equals in interface Comparable
Overrides:
equals in class java.lang.Object
Parameters:
other - object to compare to

getObject

public java.lang.Object getObject()
Returns:
the Object of this Comparable element

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String description of this Comparable


This API and code belongs to the JavaPOS committee please see LISCENCE file for details