source: src/main/java/agents/anac/y2014/AgentYK/PairBidElement.java

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

Initial import : Genius 9.0.0

File size: 978 bytes
Line 
1package agents.anac.y2014.AgentYK;
2
3import genius.core.misc.Pair;
4
5public class PairBidElement extends Pair<BidElement, BidElement> {
6 private static final long serialVersionUID = 19901213L;
7
8 /*
9 * first.getIssueNumber() <= second.getIssueNumber() by force.
10 */
11 public PairBidElement(BidElement fst, BidElement snd) {
12 super(fst, snd);
13 if(fst.getIssueNumber() > snd.getIssueNumber()) {
14 super.setFirst(snd);
15 super.setSecond(fst);
16 }
17 }
18
19 public boolean equals(PairBidElement other) {
20 if( (this.getFirst().equals(other.getFirst()) && this.getSecond().equals(other.getSecond())) ||
21 (this.getFirst().equals(other.getSecond()) && this.getSecond().equals(other.getFirst()))) {
22 return true;
23 }
24 return false;
25 }
26
27 public String toString() {
28 String str = "" + this.getFirst().getIssueNumber() + ":" + this.getFirst().getValue().toString() + " , "
29 + this.getSecond().getIssueNumber() + ":" + this.getSecond().getValue().toString();
30 return str;
31 }
32}
Note: See TracBrowser for help on using the repository browser.