org.apache.commons.jxpath.ri.compiler
Class Constant

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.compiler.Expression
      extended byorg.apache.commons.jxpath.ri.compiler.Constant

public class Constant
extends Expression

A compile tree element containing a constant number or string.

Version:
$Revision: 1.8 $ $Date: 2004/02/29 14:17:39 $
Author:
Dmitri Plotnikov

Nested Class Summary
 
Nested classes inherited from class org.apache.commons.jxpath.ri.compiler.Expression
Expression.PointerIterator, Expression.ValueIterator
 
Field Summary
private  java.lang.Object value
           
 
Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression
NOT_A_NUMBER, ONE, ZERO
 
Constructor Summary
Constant(java.lang.Number number)
           
Constant(java.lang.String string)
           
 
Method Summary
 java.lang.Object compute(EvalContext context)
           
 boolean computeContextDependent()
          Returns false
 java.lang.Object computeValue(EvalContext context)
          Returns the value of the constant.
 boolean isContextDependent()
          Returns false
 java.lang.String toString()
           
 
Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression
iterate, iteratePointers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

private java.lang.Object value
Constructor Detail

Constant

public Constant(java.lang.Number number)

Constant

public Constant(java.lang.String string)
Method Detail

compute

public java.lang.Object compute(EvalContext context)
Specified by:
compute in class Expression

computeValue

public java.lang.Object computeValue(EvalContext context)
Returns the value of the constant.

Specified by:
computeValue in class Expression

isContextDependent

public boolean isContextDependent()
Returns false

Overrides:
isContextDependent in class Expression

computeContextDependent

public boolean computeContextDependent()
Returns false

Specified by:
computeContextDependent in class Expression

toString

public java.lang.String toString()