1 8 14 package jfun.yan; 15 16 import jfun.yan.function.Function; 17 18 28 public final class ParameterEntry implements java.io.Serializable { 29 private final Function f; 30 private final int pos; 31 32 37 public ParameterEntry(final Function f, final int pos) { 38 this.f = f; 39 this.pos = pos; 40 } 41 42 46 public Function getFunction() { 47 return f; 48 } 49 53 public int getOrdinalPosition() { 54 return pos; 55 } 56 57 public boolean equals(Object obj) { 58 if(obj instanceof ParameterEntry){ 59 final ParameterEntry other = (ParameterEntry)obj; 60 return pos == other.pos && f.equals(other.f); 61 } 62 else return false; 63 } 64 public int hashCode() { 65 return f.hashCode()*31+pos; 66 } 67 public String toString() { 68 return "parameter " + pos + " of <" + f + ">"; 69 } 70 } 71 | Popular Tags |