1 package jfun.yan.xml; 2 3 15 public class DelegatingNutsFunction implements NutsFunction { 16 private final NutsFunction fun; 17 18 public String [] getParameterNames() { 19 return fun.getParameterNames(); 20 } 21 24 public NutsFunction getDelegateTarget(){ 25 return fun; 26 } 27 31 public DelegatingNutsFunction(NutsFunction fun) { 32 this.fun = fun; 33 } 34 35 public Object call(Object [] args) { 36 return fun.call(args); 37 } 38 39 public Location getLocation() { 40 return fun.getLocation(); 41 } 42 43 public String getName() { 44 return fun.getName(); 45 } 46 47 public int getParameterCount() { 48 return fun.getParameterCount(); 49 } 50 51 public Class getReturnType() { 52 return fun.getReturnType(); 53 } 54 public boolean equals(Object obj) { 55 if(obj instanceof DelegatingNutsFunction){ 56 DelegatingNutsFunction other = (DelegatingNutsFunction)obj; 57 return fun==null?other.fun==null:fun.equals(other.fun); 58 } 59 else return false; 60 } 61 public int hashCode() { 62 return fun.hashCode(); 63 } 64 public String toString() { 65 return fun.toString(); 66 } 67 68 } 69 | Popular Tags |