1 28 29 package com.caucho.xpath.expr; 30 31 import com.caucho.xpath.Expr; 32 import com.caucho.xpath.XPathException; 33 import com.caucho.xpath.pattern.NodeIterator; 34 35 38 public class ObjectVar extends Var { 39 private Object object; 40 41 44 public ObjectVar(Object object) 45 { 46 this.object = object; 47 } 48 49 52 double getDouble() 53 throws XPathException 54 { 55 double v = Expr.toDouble(getObject()); 56 57 return v; 58 } 59 60 63 Object getObject() 64 { 65 if (object instanceof NodeIterator) 66 return ((NodeIterator) object).clone(); 67 else 68 return object; 69 } 70 71 public String toString() 72 { 73 return "[ObjectVar " + object + "]"; 74 } 75 } 76 77 | Popular Tags |