org.basex.query.xpath.values
Class Literal

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.values.Item
          extended by org.basex.query.xpath.values.Literal
All Implemented Interfaces:
Result

public final class Literal
extends Item

XPath Literal.

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

Constructor Summary
Literal(byte[] chars)
          Constructor.
 
Method Summary
 boolean appr(Item val)
          Checks the approximate equality of the value and the specified value.
 boolean bool()
          Returns the boolean value.
 boolean eq(Item val)
          Checks the equality of the value and the specified value.
 Literal eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 double num()
          Returns the double value.
 int prec()
          Returns the evaluation precedence.
 byte[] str()
          Returns the literal value.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.values.Item
compile, sameAs, serialize, serialize, size, usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
indexEquivalent, indexSizes, returnedValue, sameAs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(byte[] chars)
Constructor.

Parameters:
chars - Characters to represent
Method Detail

appr

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

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

bool

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

Specified by:
bool in class Item
Returns:
boolean value

eq

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

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

eval

public Literal 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

num

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

Specified by:
num in class Item
Returns:
double value

prec

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

Returns:
evaluation precedence

str

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

Specified by:
str in class Item
Returns:
literal value

toString

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