E - the type of the first elementF - the type of the second elementpublic class Pair<E,F> extends Object
| Constructor and Description |
|---|
Pair()
Initializes an empty pair.
|
Pair(E obj1,
F obj2)
Initializes the elements of this pair with the given parameters
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
E |
getFirst()
returns the first element of this pair
|
F |
getSecond()
returns the second element of this pair
|
int |
hashCode() |
void |
setFirst(E obj1)
sets the first element of this pair
|
void |
setSecond(F obj2)
sets the second element of this pair
|
String |
toString()
returns a string representation of a pair as "(obj1, obj2)"
|
public E getFirst()
public void setFirst(E obj1)
obj1 - an object of type Epublic F getSecond()
public void setSecond(F obj2)
obj2 - an object of type FCopyright © 2018. All rights reserved.