xacute.quilt
Class ValueNum

java.lang.Object
  |
  +--xacute.quilt.QuiltExpression
        |
        +--xacute.quilt.ValueCompared
              |
              +--xacute.quilt.ValueNum
All Implemented Interfaces:
PPrintable, Value

public class ValueNum
extends ValueCompared

This class represents Quilt's numeric basic values.
We store this value as a float, even if it is an integer.
Whenever a Quilt's string value can be converted to a numeric value, it must be done !


Constructor Summary
ValueNum(float f)
          Constructs a ValueNum from a float number.
ValueNum(java.lang.String s)
          Constructs a ValueNum from a String.
 
Method Summary
 boolean compare(int op, ValueBool b, EvalContext con)
           
 boolean compare(int op, ValueNode n, EvalContext con)
           
 boolean compare(int op, ValueNodeList nl, EvalContext con)
           
 boolean compare(int op, ValueNum f, EvalContext con)
           
 boolean compare(int op, ValueString s, EvalContext con)
           
 Value filter(QuiltExpression[] filters, EvalContext con)
           
 java.lang.String pprint()
           
 java.lang.String printResult()
           
 boolean toBool(EvalContext con)
           
 float toNum(EvalContext con)
          Accessor to the numeric value.
 void toSAX(org.xml.sax.DocumentHandler handler)
           
 java.lang.String toString(EvalContext con)
           
 
Methods inherited from class xacute.quilt.ValueCompared
compare, isNodeValue, toNode, toNodeList
 
Methods inherited from class xacute.quilt.QuiltExpression
isTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueNum

public ValueNum(java.lang.String s)
Constructs a ValueNum from a String.

ValueNum

public ValueNum(float f)
Constructs a ValueNum from a float number.
Method Detail

toSAX

public void toSAX(org.xml.sax.DocumentHandler handler)
           throws org.xml.sax.SAXException

toBool

public boolean toBool(EvalContext con)

pprint

public java.lang.String pprint()
Overrides:
pprint in class QuiltExpression

toString

public java.lang.String toString(EvalContext con)
Overrides:
toString in class ValueCompared

toNum

public float toNum(EvalContext con)
Accessor to the numeric value.

printResult

public java.lang.String printResult()

filter

public Value filter(QuiltExpression[] filters,
                    EvalContext con)
             throws QuiltException

compare

public boolean compare(int op,
                       ValueBool b,
                       EvalContext con)
                throws QuiltException

compare

public boolean compare(int op,
                       ValueNum f,
                       EvalContext con)
                throws QuiltException

compare

public boolean compare(int op,
                       ValueString s,
                       EvalContext con)
                throws QuiltException

compare

public boolean compare(int op,
                       ValueNode n,
                       EvalContext con)
                throws QuiltException

compare

public boolean compare(int op,
                       ValueNodeList nl,
                       EvalContext con)
                throws QuiltException