quoggles.auxboxes.sort
Class Sort_Box.ComparableWrapper

java.lang.Object
  |
  +--quoggles.auxboxes.sort.Sort_Box.ComparableWrapper
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
Sort_Box

class Sort_Box.ComparableWrapper
extends java.lang.Object
implements java.lang.Comparable

This class encapsulates an arbitrary object. It implements interface Comparable. If the wrapped object does not itself implement Comparable, the compareTo method uses the string representation of the object.


Field Summary
private  java.lang.Object val
           
 
Constructor Summary
Sort_Box.ComparableWrapper(java.lang.Object value)
          Constructor taking the wrapped object as parameter.
 
Method Summary
 int compareTo(java.lang.Object o)
          Uses the string representation of the wrapped object if this does not implement interface Comparable.
 java.lang.Object getValue()
          Returns the value this class wraps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

private java.lang.Object val
Constructor Detail

Sort_Box.ComparableWrapper

public Sort_Box.ComparableWrapper(java.lang.Object value)
Constructor taking the wrapped object as parameter.

Parameters:
value - the object that is wrapped in this class.
Method Detail

getValue

public java.lang.Object getValue()
Returns the value this class wraps.

Returns:
the value this class wraps.

compareTo

public int compareTo(java.lang.Object o)
Uses the string representation of the wrapped object if this does not implement interface Comparable.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)