1 package jfun.parsec; 2 3 import jfun.util.Misc; 4 5 17 public class Tuple5<A, B, C, D, E> extends Tuple4<A,B,C,D>{ 18 private E value5; 19 public Tuple5(A value1, B value2, C value3, D value4, E value5) { 20 super(value1, value2, value3, value4); 21 this.value5 = value5; 22 } 23 public Tuple5() { 24 } 25 public E getValue5() { 26 return value5; 27 } 28 public void setValue5(E value5) { 29 this.value5 = value5; 30 } 31 public boolean equals(Tuple5 other){ 32 return super.equals(other) && Misc.equals(value5, other.value5); 33 } 34 @Override 35 public boolean equals(Object obj) { 36 if(obj instanceof Tuple5){ 37 return equals((Tuple5)obj); 38 } 39 else return false; 40 } 41 @Override 42 public int hashCode() { 43 return super.hashCode()*31+Misc.hashcode(value5); 44 } 45 @Override 46 public String toString() { 47 return "("+getValue1()+","+getValue2() 48 +","+getValue3()+","+getValue4()+","+getValue5()+")"; 49 } 50 } 51 | Popular Tags |