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:
Serializable
- Direct Known Subclasses:
Division
This class implements a simple pair of elements.
- Author:
- Matthias Thimm, Bastian Wolf
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getFirst()
returns the first element of this pairreturns the second element of this pairint
hashCode()
void
sets the first element of this pairvoid
sets the second element of this pairtoString()
returns a string representation of a pair as "(obj1, obj2)"
-
Constructor Details
-
Pair
public Pair()Initializes an empty pair. -
Pair
-
-
Method Details
-
getFirst
-
setFirst
sets the first element of this pair- Parameters:
obj1
- an object of type E
-
getSecond
returns the second element of this pair- Returns:
- the second element of this pair
-
setSecond
sets the second element of this pair- Parameters:
obj2
- an object of type F
-
hashCode
-
equals
-
toString
-