Package org.tweetyproject.commons.util
Class Pair<E,F>
- java.lang.Object
 - 
- org.tweetyproject.commons.util.Pair<E,F>
 
 
- 
- Type Parameters:
 E- the type of the first elementF- the type of the second element
- All Implemented Interfaces:
 java.io.Serializable
- Direct Known Subclasses:
 Division
public class Pair<E,F> extends java.lang.Object implements java.io.SerializableThis class implements a simple pair of elements.- Author:
 - Matthias Thimm, Bastian Wolf
 - See Also:
 - Serialized Form
 
 
- 
- 
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)EgetFirst()returns the first element of this pairFgetSecond()returns the second element of this pairinthashCode()voidsetFirst(E obj1)sets the first element of this pairvoidsetSecond(F obj2)sets the second element of this pairjava.lang.StringtoString()returns a string representation of a pair as "(obj1, obj2)" 
 - 
 
- 
- 
Method Detail
- 
getFirst
public E getFirst()
returns the first element of this pair- Returns:
 - the first element of this pair
 
 
- 
setFirst
public void setFirst(E obj1)
sets the first element of this pair- Parameters:
 obj1- an object of type E
 
- 
getSecond
public F getSecond()
returns the second element of this pair- Returns:
 - the second element of this pair
 
 
- 
setSecond
public void setSecond(F obj2)
sets the second element of this pair- Parameters:
 obj2- an object of type F
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
toString
public java.lang.String toString()
returns a string representation of a pair as "(obj1, obj2)"- Overrides:
 toStringin classjava.lang.Object- Returns:
 - a string representation of a pair as "(obj1, obj2)"
 
 
 - 
 
 -