source: src/main/java/agents/ai2014/group10/Pair.java@ 1

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

Initial import : Genius 9.0.0

File size: 713 bytes
Line 
1package agents.ai2014.group10;
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.