source: src/main/java/agents/anac/y2015/pokerface/Pair.java

Last change on this file was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 719 bytes
Line 
1package agents.anac.y2015.pokerface;
2
3@SuppressWarnings("hiding")
4public class Pair<Integer,Value> {
5
6 private final Integer i;
7 private final Value val;
8
9 public Pair(Integer i, Value val) {
10 this.i = i;
11 this.val = val;
12 }
13
14 public Integer getInteger() { return i; }
15 public Value getValue() { return val; }
16
17 @Override
18 public int hashCode() { return i.hashCode() ^ val.hashCode(); }
19
20 @Override
21 public boolean equals(Object o) {
22 if (o == null) return false;
23 if (!(o instanceof Pair)) return false;
24 @SuppressWarnings("unchecked")
25 Pair<Integer, Value> pairo = (Pair<Integer, Value>) o;
26 return this.i.equals(pairo.getInteger()) &&
27 this.val.equals(pairo.getValue());
28 }
29
30}
Note: See TracBrowser for help on using the repository browser.