org.basex.query.xquery.item
Class Dec

java.lang.Object
  extended by org.basex.query.xquery.expr.Expr
      extended by org.basex.query.xquery.item.Item
          extended by org.basex.query.xquery.item.Num
              extended by org.basex.query.xquery.item.Dec

public class Dec
extends Num

Decimal item.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.query.xquery.expr.Expr
type
 
Constructor Summary
Dec(byte[] t)
          Constructor.
Dec(double d)
          Constructor.
Dec(double v, long l)
          Constructor.
Dec(long v, Type t)
          Constructor.
 
Method Summary
 boolean bool()
          Returns a boolean representation of the item.
 double dbl()
          Returns a double representation of the item.
 int diff(Item it)
          Returns the difference between the current and the specified item.
 boolean eq(Item it)
          Checks the items for equality.
 float flt()
          Returns a float representation of the item.
 long itr()
          Returns a numeric (long) representation of the item.
 byte[] str()
          Returns an atomized string.
 
Methods inherited from class org.basex.query.xquery.item.Num
n
 
Methods inherited from class org.basex.query.xquery.item.Item
castErr, comp, eval, i, info, iter, serialize, serialize, size, toString
 
Methods inherited from class org.basex.query.xquery.expr.Expr
cls, d, e, node, s, u
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dec

public Dec(byte[] t)
Constructor.

Parameters:
t - string representation

Dec

public Dec(double d)
    throws XQException
Constructor.

Parameters:
d - double value
Throws:
XQException - evaluation exception

Dec

public Dec(double v,
           long l)
    throws XQException
Constructor.

Parameters:
v - value
l - long representation
Throws:
XQException - evaluation exception

Dec

public Dec(long v,
           Type t)
Constructor.

Parameters:
v - value
t - data type
Method Detail

bool

public final boolean bool()
Description copied from class: Item
Returns a boolean representation of the item.

Overrides:
bool in class Item
Returns:
boolean value

dbl

public final double dbl()
Description copied from class: Item
Returns a double representation of the item.

Overrides:
dbl in class Item
Returns:
double value

diff

public final int diff(Item it)
               throws XQException
Description copied from class: Item
Returns the difference between the current and the specified item.

Overrides:
diff in class Item
Parameters:
it - item to be compared.
Returns:
difference
Throws:
XQException - evaluation exception

eq

public final boolean eq(Item it)
                 throws XQException
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
it - item to be compared.
Returns:
result of check
Throws:
XQException - evaluation exception

flt

public final float flt()
Description copied from class: Item
Returns a float representation of the item.

Overrides:
flt in class Item
Returns:
float value

itr

public final long itr()
Description copied from class: Item
Returns a numeric (long) representation of the item.

Overrides:
itr in class Item
Returns:
long value

str

public final byte[] str()
Description copied from class: Expr
Returns an atomized string.

Overrides:
str in class Expr
Returns:
string representation