org.basex.query.xpath.item
Class Dbl

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xpath.expr.Expr
          extended by org.basex.query.xpath.item.Item
              extended by org.basex.query.xpath.item.Dbl
All Implemented Interfaces:
Result

public final class Dbl
extends Item

XPath value type modeling a number.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Tim Petrowsky

Field Summary
static Dbl ONE
          Static number.
static Dbl ZERO
          Static number.
 
Constructor Summary
Dbl(byte[] n)
          Constructor.
Dbl(double n)
          Constructor.
Dbl(long n)
          Constructor.
 
Method Summary
 boolean appr(Item v)
          Checks the approximate equality of the value and the specified value.
 boolean bool()
          Returns the boolean value.
 boolean eq(Item v)
          Checks the equality of the value and the specified value.
 Dbl eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 double num()
          Returns the double value.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 int prec()
          Returns the evaluation precedence.
 byte[] str()
          Returns the literal value.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.item.Item
comp, same, serialize, serialize, size, usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
indexEquivalent, indexSizes, returnedValue, sameAs
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Dbl ZERO
Static number.


ONE

public static final Dbl ONE
Static number.

Constructor Detail

Dbl

public Dbl(double n)
Constructor.

Parameters:
n - number to be represented.

Dbl

public Dbl(long n)
Constructor.

Parameters:
n - number to be represented.

Dbl

public Dbl(byte[] n)
Constructor.

Parameters:
n - number to be represented.
Method Detail

eval

public Dbl eval(XPContext ctx)
Description copied from class: Expr
Evaluates the expression with the specified context set. Additionally provides a context

Specified by:
eval in class Expr
Parameters:
ctx - query context
Returns:
resulting XPathValue

bool

public boolean bool()
Description copied from class: Item
Returns the boolean value.

Specified by:
bool in class Item
Returns:
boolean value

str

public byte[] str()
Description copied from class: Item
Returns the literal value.

Specified by:
str in class Item
Returns:
literal value

num

public double num()
Description copied from class: Item
Returns the double value.

Specified by:
num in class Item
Returns:
double value

eq

public boolean eq(Item v)
Description copied from class: Item
Checks the equality of the value and the specified value.

Specified by:
eq in class Item
Parameters:
v - value to be compared
Returns:
result of comparison.

appr

public boolean appr(Item v)
Description copied from class: Item
Checks the approximate equality of the value and the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

prec

public int prec()
Description copied from class: Item
Returns the evaluation precedence.

Returns:
evaluation precedence

toString

public java.lang.String toString()
Specified by:
toString in class Item

plan

public void plan(Serializer ser)
          throws java.io.IOException
Description copied from class: ExprInfo
Recursively sends the abstract syntax of this expression to the specified serializer.

Specified by:
plan in class ExprInfo
Parameters:
ser - serializer
Throws:
java.io.IOException - exception