org.basex.query.value.item
Class Bln

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.Bln
All Implemented Interfaces:
java.lang.Iterable<Item>

public final class Bln
extends Item

Boolean item (xs:boolean).

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Flag
 
Field Summary
static Bln FALSE
          Static boolean item without scoring.
static Bln TRUE
          Static boolean item without scoring.
 
Fields inherited from class org.basex.query.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Method Summary
 boolean bool(InputInfo ii)
          Returns a boolean representation of the value.
 double dbl(InputInfo ii)
          Returns a double representation of the value.
 java.math.BigDecimal dec(InputInfo ii)
          Returns a decimal representation of the value.
 int diff(Item it, Collation coll, InputInfo ii)
          Returns the difference between the current and the specified item.
 boolean eq(Item it, Collation coll, InputInfo ii)
          Checks the items for equality.
 float flt(InputInfo ii)
          Returns a float representation of the value.
static Bln get(boolean b)
          Returns a static item instance.
static Bln get(double s)
          Constructor, adding a full-text score.
 long itr(InputInfo ii)
          Returns an integer (long) representation of the value.
static boolean parse(byte[] str, InputInfo ii)
          Converts the specified string to a boolean.
 boolean sameAs(Expr cmp)
          Compares the current and specified expression for equality.
 byte[] string()
          Returns the string value.
 byte[] string(InputInfo ii)
          Returns a string representation of the value.
 java.lang.Boolean toJava()
          Returns a Java representation of the value.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.value.item.Item
castErr, comparable, description, ebv, equiv, hash, homogeneous, input, isItem, item, itemAt, iter, iterable, materialize, plan, score, score, size, test, 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, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, 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
 

Field Detail

TRUE

public static final Bln TRUE
Static boolean item without scoring.


FALSE

public static final Bln FALSE
Static boolean item without scoring.

Method Detail

get

public static Bln get(double s)
Constructor, adding a full-text score.

Parameters:
s - score value
Returns:
item

get

public static Bln get(boolean b)
Returns a static item instance.

Parameters:
b - boolean value
Returns:
item

string

public 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

string

public byte[] string()
Returns the string value.

Returns:
string value

bool

public boolean bool(InputInfo ii)
Description copied from class: Item
Returns a boolean representation of the value.

Overrides:
bool in class Item
Parameters:
ii - input info
Returns:
boolean value

itr

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

dbl

public 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

dec

public java.math.BigDecimal dec(InputInfo ii)
Description copied from class: Item
Returns a decimal representation of the value.

Overrides:
dec in class Item
Parameters:
ii - input info
Returns:
decimal value

eq

public boolean eq(Item it,
                  Collation coll,
                  InputInfo ii)
           throws QueryException
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
it - item to be compared
coll - collation
ii - input info
Returns:
result of check
Throws:
QueryException - query exception

diff

public int diff(Item it,
                Collation coll,
                InputInfo ii)
         throws QueryException
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
coll - query context
ii - input info
Returns:
difference
Throws:
QueryException - query exception

toJava

public java.lang.Boolean toJava()
Description copied from class: Value
Returns a Java representation of the value.

Specified by:
toJava in class Value
Returns:
Java object

sameAs

public boolean sameAs(Expr cmp)
Description copied from class: Expr
Compares the current and specified expression for equality.

Overrides:
sameAs in class Expr
Parameters:
cmp - expression to be compared
Returns:
result of check

parse

public static boolean parse(byte[] str,
                            InputInfo ii)
                     throws QueryException
Converts the specified string to a boolean.

Parameters:
str - string to be checked
ii - input info
Returns:
result of check
Throws:
QueryException - query exception

toString

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