com.objectwave.utility
Class DisplayPair
java.lang.Object
|
+--com.objectwave.utility.Pair
|
+--com.objectwave.utility.DisplayPair
- All Implemented Interfaces:
- java.io.Serializable
- public class DisplayPair
- extends Pair
Just like pair, this is an association between two objects.
Unlike pair, this class's toString() method will return the first object.toString() results.
This is usefull for displaying objects in a list or tree or something where you want a display
to be different than the actual object, but you want to obtain a reference to the actual object
when a selection is made.
An additional benefit is sorting. The Sorter class can sort objects and it will do so on the toString()
results.
- Version:
- 1.3
- Author:
- Dave Hoag
- See Also:
- Serialized Form
Constructor Summary |
DisplayPair()
DisplayPair constructor comment. |
DisplayPair(java.lang.Object first,
java.lang.Object second)
DisplayPair constructor comment. |
Method Summary |
java.lang.String |
toString()
This method was created in VisualAge. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DisplayPair
public DisplayPair()
- DisplayPair constructor comment.
DisplayPair
public DisplayPair(java.lang.Object first,
java.lang.Object second)
- DisplayPair constructor comment.
- Parameters:
first
- java.lang.Objectsecond
- java.lang.Object
toString
public java.lang.String toString()
- Description copied from class:
Pair
- This method was created in VisualAge.
- Overrides:
toString
in class Pair
- Returns:
- java.lang.String