|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.Pair<T1,T2>
T1
- The type of the first element.T2
- The type of the second element.public class Pair<T1,T2>
A Pair
is a container that stores two objects.
Constructor Summary | |
---|---|
Pair()
Initializes an empty pair. |
|
Pair(T1 first,
T2 second)
Generates a pair of the given two elements. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
T1 |
getFirstElement()
Returns the first element. |
T2 |
getSecondElement()
Returns the second element. |
int |
hashCode()
|
boolean |
isReflexive()
Checks whether this instance is reflexive. |
boolean |
isSymmetricTo(Pair<T1,T2> otherPair)
Checks whether the passed Pair is the symmetric correspondent of this instance. |
void |
setFirstElement(T1 elem)
Sets the first element. |
void |
setSecondElement(T2 elem)
Sets the second element. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair()
public Pair(T1 first, T2 second)
T1
and
T2
.
first
- The first element.second
- The second element.
NullPointerException
- If at least one of the parameters is null
.Method Detail |
---|
public T1 getFirstElement()
public void setFirstElement(T1 elem)
elem
- The new first element.
NullPointerException
- If null
was passed.public T2 getSecondElement()
public void setSecondElement(T2 elem)
elem
- The new second element.
NullPointerException
- If null
was passed.public boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public boolean isSymmetricTo(Pair<T1,T2> otherPair)
otherPair
- A Pair
with which the symmetric relation shall be checked.
true
, if the passed Pair
object is the symmetric correspondent of this instance; otherwise false
public String toString()
toString
in class Object
public boolean isReflexive()
true
, if this instance is reflexive; otherwise false
.public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |