org.devyant.decorutils.sdo
Class SDO

java.lang.Object
  extended by org.devyant.decorutils.sdo.SDO
All Implemented Interfaces:
java.lang.Comparable, Displayable

public class SDO
extends java.lang.Object
implements Displayable

Sortable Decorated Object.

Since:
Dec 8, 2004 7:29:42 PM
Version:
@version $Revision: 1.1$ ($Author: ftavares$)
Author:
Filipe Tavares
See Also:
Comparable, Comparator

Constructor Summary
SDO()
          Constructs a new, empty Sortable Decorated Object.
SDO(java.lang.Comparable object)
          Constructs a new Sortable Decorated Object with an empty display String.
SDO(java.lang.Comparable object, java.text.Format formatter)
          Constructs a new Sortable Decorated Object and creates display String using the specified formatter on the object.
SDO(java.lang.Comparable object, java.lang.String displayString)
          Constructs a new Sortable Decorated Object.
SDO(java.util.Comparator comparator, java.lang.Object object, java.text.Format formatter)
          Constructs a new Sortable Decorated Object and creates display String using the specified formatter on the object.
SDO(java.util.Comparator comparator, java.lang.Object object, java.lang.String displayString)
          Constructs a new Sortable Decorated Object.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 java.lang.Object getObject()
          Returns the decorated object.
 void setDisplayString(java.lang.String s)
          Set the output String.
 java.lang.String toString()
          This method overrides Object toString method returning the specified output String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SDO

public SDO()
Constructs a new, empty Sortable Decorated Object.


SDO

public SDO(java.lang.Comparable object)
Constructs a new Sortable Decorated Object with an empty display String.

Parameters:
object - Comparable object for sorting purposes

SDO

public SDO(java.lang.Comparable object,
           java.text.Format formatter)
Constructs a new Sortable Decorated Object and creates display String using the specified formatter on the object.

Parameters:
object - Comparable object for sorting purposes
formatter - output formmater

SDO

public SDO(java.lang.Comparable object,
           java.lang.String displayString)
Constructs a new Sortable Decorated Object.

Parameters:
object - Comparable object for sorting purposes
displayString - String to return on the toString() method

SDO

public SDO(java.util.Comparator comparator,
           java.lang.Object object,
           java.text.Format formatter)
Constructs a new Sortable Decorated Object and creates display String using the specified formatter on the object.

Parameters:
comparator - Comparator for sorting purposes
object - decorated object
formatter - output formmater

SDO

public SDO(java.util.Comparator comparator,
           java.lang.Object object,
           java.lang.String displayString)
Constructs a new Sortable Decorated Object.

Parameters:
comparator - Comparator for sorting purposes
object - decorated object
displayString - String to return on toString() method
Method Detail

toString

public final java.lang.String toString()
This method overrides Object toString method returning the specified output String.

Specified by:
toString in interface Displayable
Overrides:
toString in class java.lang.Object
Returns:
decorated output

compareTo

public final int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

setDisplayString

public final void setDisplayString(java.lang.String s)
Set the output String.

Specified by:
setDisplayString in interface Displayable
Parameters:
s - output String

getObject

public final java.lang.Object getObject()
Returns the decorated object.

Returns:
the object


Copyright © 2005 devyant. All Rights Reserved.