org.planx.xpath.object
Class XNumber

java.lang.Object
  extended by org.planx.xpath.expr.Expression
      extended by org.planx.xpath.object.XObject
          extended by org.planx.xpath.object.XSimple
              extended by org.planx.xpath.object.XNumber

public class XNumber
extends XSimple

A number returned by an XPath expression.


Field Summary
static XNumber NaN
           
 
Constructor Summary
XNumber(double value)
          Construct an XNumber which represents the specified double value.
XNumber(Double value)
          Construct an XNumber which represents the specified Double value.
 
Method Summary
 boolean booleanValue()
          Returns false if the value of this XNumber is NaN or 0.
 double doubleValue()
          Returns the value as a double.
 boolean equals(Object o)
          Returns true if and only if o is an instance of XNumber and it has the same value as this.
 int hashCode()
          Returns a hash code value for this object.
 int intValue()
          Returns the value as an int.
 long longValue()
          Returns the value as a long.
 String stringValue()
          Returns this XNumber as a string.
 String toString()
          Returns this XNumber as a string.
 
Methods inherited from class org.planx.xpath.object.XObject
evaluate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NaN

public static final XNumber NaN
Constructor Detail

XNumber

public XNumber(double value)
Construct an XNumber which represents the specified double value.


XNumber

public XNumber(Double value)
Construct an XNumber which represents the specified Double value.

Method Detail

doubleValue

public double doubleValue()
Returns the value as a double.

Specified by:
doubleValue in class XSimple

longValue

public long longValue()
Returns the value as a long.


intValue

public int intValue()
Returns the value as an int.


booleanValue

public boolean booleanValue()
Returns false if the value of this XNumber is NaN or 0. Otherwise returns true.

Specified by:
booleanValue in class XObject

stringValue

public String stringValue()
Returns this XNumber as a string.

Specified by:
stringValue in class XSimple

toString

public String toString()
Returns this XNumber as a string.

Overrides:
toString in class Object

equals

public boolean equals(Object o)
Returns true if and only if o is an instance of XNumber and it has the same value as this.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object


Copyright © 2010. All Rights Reserved.