1 61 62 package org.jaxen.function; 63 64 import java.util.List ; 65 66 import org.jaxen.Context; 67 import org.jaxen.Function; 68 import org.jaxen.FunctionCallException; 69 70 81 public class LastFunction implements Function 82 { 83 84 87 public LastFunction() {} 88 89 102 public Object call(Context context, 103 List args) throws FunctionCallException 104 { 105 if (args.size() == 0) 106 { 107 return evaluate( context ); 108 } 109 110 throw new FunctionCallException( "last() requires no arguments." ); 111 } 112 113 123 public static Double evaluate(Context context) 124 { 125 return new Double ( context.getSize() ); 126 } 127 128 } 129 | Popular Tags |