adavid.util
Class SortableAdapter
java.lang.Object
|
+--adavid.util.SortableAdapter
- Direct Known Subclasses:
- SortableObject
- public class SortableAdapter
- extends java.lang.Object
- implements Sortable
Constructor Summary |
SortableAdapter(java.lang.Object object)
constructor: the object to be wrapped
the object must not be null!
if it is null, a NullPointerException will
be raised one day, which is a good thing because
one is not supposed to sort null objects |
Method Summary |
boolean |
equals(Sortable s)
returns true if the given sortable is equal to this object |
java.lang.Object |
getObject()
methods to give access to the wrapped object |
boolean |
isGreaterThan(Sortable s)
returns true if the given sortable is greater (strictly) than this object |
boolean |
isLessThan(Sortable s)
returns true if the given sortable is less (strictly) than this object |
void |
setObject(java.lang.Object o)
|
static SortableAdapter[] |
toSortableAdapters(java.lang.Object[] objs)
convenient method to build arrays of sortable elements |
java.lang.String |
toString()
gives the string representation of this object,
used also for the test. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
SortableAdapter
public SortableAdapter(java.lang.Object object)
- constructor: the object to be wrapped
the object must not be null!
if it is null, a NullPointerException will
be raised one day, which is a good thing because
one is not supposed to sort null objects
toSortableAdapters
public static SortableAdapter[] toSortableAdapters(java.lang.Object[] objs)
- convenient method to build arrays of sortable elements
toString
public java.lang.String toString()
- gives the string representation of this object,
used also for the test. Overriding this method
may be useful... it is done for ObjectString
- Specified by:
- toString in interface Sortable
- Overrides:
- toString in class java.lang.Object
isLessThan
public boolean isLessThan(Sortable s)
- returns true if the given sortable is less (strictly) than this object
- Specified by:
- isLessThan in interface Sortable
isGreaterThan
public boolean isGreaterThan(Sortable s)
- returns true if the given sortable is greater (strictly) than this object
- Specified by:
- isGreaterThan in interface Sortable
equals
public boolean equals(Sortable s)
- returns true if the given sortable is equal to this object
- Specified by:
- equals in interface Sortable
getObject
public java.lang.Object getObject()
- methods to give access to the wrapped object
setObject
public void setObject(java.lang.Object o)