org.basex.query.value.item
Class ANum

java.lang.Object
  extended by org.basex.data.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.value.Value
              extended by org.basex.query.value.item.Item
                  extended by org.basex.query.value.item.ANum
All Implemented Interfaces:
java.lang.Iterable<Item>
Direct Known Subclasses:
Dbl, Dec, Flt, Int

public abstract class ANum
extends Item

Abstract super class for all numeric items. Useful for removing exceptions and unifying hash values.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Flag
 
Field Summary
 
Fields inherited from class org.basex.query.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Method Summary
abstract  double dbl()
          Returns an double representation of the value.
 double dbl(InputInfo ii)
          Returns a double representation of the value.
abstract  float flt()
          Returns an float representation of the value.
 float flt(InputInfo ii)
          Returns a float representation of the value.
 int hash(InputInfo ii)
          Returns a hash code for this value.
abstract  long itr()
          Returns an integer (long) representation of the value.
 long itr(InputInfo ii)
          Returns an integer (long) representation of the value.
abstract  byte[] string()
          Returns a string representation of the value.
 byte[] string(InputInfo ii)
          Returns a string representation of the value.
 Item test(QueryContext ctx, InputInfo ii)
          Performs a predicate test and returns the item if test was successful.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.value.item.Item
bool, castErr, comparable, dec, description, diff, ebv, eq, equiv, homogeneous, input, isItem, item, itemAt, iter, iterable, materialize, plan, score, score, size, type, typeId, writeTo, xdmInfo
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, toJava, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

string

public final byte[] string(InputInfo ii)
Description copied from class: Item
Returns a string representation of the value.

Specified by:
string in class Item
Parameters:
ii - input info, use null if none is available
Returns:
string value

dbl

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

Overrides:
dbl in class Item
Parameters:
ii - input info
Returns:
double value

itr

public final long itr(InputInfo ii)
Description copied from class: Item
Returns an integer (long) representation of the value.

Overrides:
itr in class Item
Parameters:
ii - input info
Returns:
long value

flt

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

Overrides:
flt in class Item
Parameters:
ii - input info
Returns:
float value

string

public abstract byte[] string()
Returns a string representation of the value.

Returns:
string value

itr

public abstract long itr()
Returns an integer (long) representation of the value.

Returns:
long value

dbl

public abstract double dbl()
Returns an double representation of the value.

Returns:
double value

flt

public abstract float flt()
Returns an float representation of the value.

Returns:
float value

test

public Item test(QueryContext ctx,
                 InputInfo ii)
          throws QueryException
Description copied from class: Expr
Performs a predicate test and returns the item if test was successful.

Overrides:
test in class Item
Parameters:
ctx - query context
ii - input info
Returns:
item
Throws:
QueryException - query exception

hash

public final int hash(InputInfo ii)
Description copied from class: Value
Returns a hash code for this value.

Overrides:
hash in class Item
Parameters:
ii - input info
Returns:
hash code

toString

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