|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.util.Pair<T,U>
T
- the type of the first element of the pairU
- the type of the second element of the pairpublic class Pair<T,U>
A generic class that contains a pair of two objects of types T and U. This class is useful when you
want to bind two objects together without the overhead of creating a custom class.
Note that you can use wild-cards when creating Pairs:
Pair<? extends Number, ? extends Number> p = new Pair<Integer, Integer>(1, 2);
Constructor Summary | |
---|---|
Pair()
Creates a Pair in which both elements are null |
|
Pair(T first,
U second)
Creates a Pair using the supplied first and second parameters as the values for the first and second properties, respectively. |
Method Summary | |
---|---|
T |
getFirst()
Retrieve the first element of the pair |
U |
getSecond()
Retrieve the second element of the pair |
void |
setFirst(T first)
Specify the first element of the pair |
void |
setSecond(U second)
Specify the second element of the pair |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair()
public Pair(T first, U second)
first
- the first element of the pairsecond
- the second element of the pairMethod Detail |
---|
public void setFirst(T first)
first
- the first element of the pairpublic void setSecond(U second)
second
- the second element of the pairpublic T getFirst()
public U getSecond()
public String toString()
toString
in class Object
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |