|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.ExprInfo
org.basex.query.expr.Expr
org.basex.query.value.Value
org.basex.query.value.item.Item
public abstract class Item
Abstract super class for all items.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary | |
---|---|
java.lang.Double |
score
Score value. |
static int |
UNDEF
Undefined item. |
Fields inherited from class org.basex.query.value.Value |
---|
type |
Constructor Summary | |
---|---|
protected |
Item(Type t)
Constructor. |
Method Summary | |
---|---|
boolean |
bool(InputInfo ii)
Returns a boolean representation of the value. |
protected QueryException |
castErr(java.lang.Object val,
InputInfo ii)
Throws a cast error. |
boolean |
comparable(Item it)
Checks if the items can be compared. |
double |
dbl(InputInfo ii)
Returns a double representation of the value. |
java.math.BigDecimal |
dec(InputInfo ii)
Returns a decimal representation of the value. |
java.lang.String |
description()
Returns a string description of the expression. |
int |
diff(Item it,
Collation coll,
InputInfo ii)
Returns the difference between the current and the specified item. |
Item |
ebv(QueryContext ctx,
InputInfo ii)
Checks if the iterator can be dissolved into an effective boolean value. |
abstract boolean |
eq(Item it,
Collation coll,
InputInfo ii)
Checks the items for equality. |
boolean |
equiv(Item it,
Collation coll,
InputInfo ii)
Checks the items for equivalence. |
float |
flt(InputInfo ii)
Returns a float representation of the value. |
int |
hash(InputInfo ii)
Returns a hash code for this value. |
boolean |
homogeneous()
Checks if all items of this value share the same type. |
BufferInput |
input(InputInfo ii)
Returns an input stream. |
boolean |
isItem()
Tests if this is an item. |
Item |
item(QueryContext ctx,
InputInfo ii)
Evaluates the expression and returns the resulting item or a null reference, if the expression yields an empty sequence. |
Item |
itemAt(long pos)
Gets the item at the given position in the value. |
ValueIter |
iter()
Returns an iterator. |
boolean |
iterable()
Returns true if the expression is iterable, i.e., if it will not contain any duplicate nodes and if all nodes will be are sorted. |
long |
itr(InputInfo ii)
Returns an integer (long) representation of the value. |
Item |
materialize(InputInfo ii)
Materializes streamable values, or returns a self reference. |
void |
plan(FElem plan)
Creates an expression tree. |
double |
score()
Returns a score value. |
void |
score(double s)
Sets a new score value. |
long |
size()
Returns the sequence size or 1. |
abstract 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. |
SeqType |
type()
Returns the static type of the evaluated value. |
Type.ID |
typeId()
Returns a type id. |
int |
writeTo(Item[] arr,
int start)
Writes this value's items out to the given array. |
byte[] |
xdmInfo()
Returns data model info. |
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, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEF
public java.lang.Double score
null
reference takes less memory on 32bit than a double.
Constructor Detail |
---|
protected Item(Type t)
t
- data typeMethod Detail |
---|
public final ValueIter iter()
Value
iter
in class Value
public final Item item(QueryContext ctx, InputInfo ii)
Expr
null
reference, if the expression yields an empty sequence.
If this method is not overwritten, Expr.iter(org.basex.query.QueryContext)
must be implemented
by an expression, as it may be called by this method.
item
in class Expr
ctx
- query contextii
- input info
public final Item itemAt(long pos)
Value
itemAt
in class Value
pos
- position
public final Item ebv(QueryContext ctx, InputInfo ii)
Expr
ebv
in class Expr
ctx
- query contextii
- input info
public Item test(QueryContext ctx, InputInfo ii) throws QueryException
Expr
test
in class Expr
ctx
- query contextii
- input info
QueryException
- query exceptionpublic final boolean isItem()
Expr
isItem
in class Expr
public abstract byte[] string(InputInfo ii) throws QueryException
ii
- input info, use null
if none is available
QueryException
- if the item can't be atomizedpublic boolean bool(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic java.math.BigDecimal dec(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic long itr(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic float flt(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic double dbl(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic final boolean comparable(Item it)
it
- item to be compared
public abstract boolean eq(Item it, Collation coll, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- collationii
- input info
QueryException
- query exceptionpublic final boolean equiv(Item it, Collation coll, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- collationii
- input info
QueryException
- query exceptionpublic int diff(Item it, Collation coll, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- query contextii
- input info
QueryException
- query exceptionpublic BufferInput input(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic Item materialize(InputInfo ii) throws QueryException
ii
- input info
QueryException
- query exceptionpublic final SeqType type()
Expr
type
in class Expr
public final long size()
Expr
size
in class Value
public final boolean iterable()
Expr
AxisPath
.
iterable
in class Expr
public double score()
public final void score(double s)
s
- score valueprotected final QueryException castErr(java.lang.Object val, InputInfo ii) throws QueryException
val
- cast valueii
- input info
QueryException
- query exceptionpublic java.lang.String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.
description
in class Value
public void plan(FElem plan)
ExprInfo
plan
in class ExprInfo
plan
- root elementpublic int hash(InputInfo ii) throws QueryException
Value
hash
in class Value
ii
- input info
QueryException
- if atomization can't be applied (e.g. function item)public final int writeTo(Item[] arr, int start)
Value
writeTo
in class Value
arr
- array to write tostart
- start position
public final boolean homogeneous()
Value
homogeneous
in class Value
public byte[] xdmInfo()
public Type.ID typeId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |