1
package dk.aau.cs.model.tapn.Colored;
3
public class Pair<A, B> {
7
public Pair(A first, B second) {
13
public int hashCode() {
14
int hashFirst = first != null ? first.hashCode() : 0;
15
int hashSecond = second != null ? second.hashCode() : 0;
17
return (hashFirst + hashSecond) * hashSecond + hashFirst;
20
public boolean equals(Object other) {
21
if (other instanceof Pair) {
22
Pair otherPair = (Pair) other;
24
(( this.first == otherPair.first ||
25
( this.first != null && otherPair.first != null &&
26
this.first.equals(otherPair.first))) &&
27
( this.second == otherPair.second ||
28
( this.second != null && otherPair.second != null &&
29
this.second.equals(otherPair.second))) );
35
public String toString()
37
return "(" + first + ", " + second + ")";
44
public void setFirst(A first) {
48
public B getSecond() {
52
public void setSecond(B second) {