Modifier and Type | Field and Description |
---|---|
protected Double |
score
Score value.
|
static int |
UNDEF
Undefined item.
|
Modifier | Constructor and Description |
---|---|
protected |
Item(Type type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Item |
atomItem(InputInfo ii)
Evaluates the expression and returns the atomized items.
|
Item |
atomItem(QueryContext qc,
InputInfo ii)
Evaluates the expression and returns zero or one atomized item, or an error.
|
long |
atomSize()
Computes the number of atomized items.
|
Value |
atomValue(InputInfo ii)
Evaluates the expression and returns the atomized items.
|
boolean |
bool(InputInfo ii)
Returns a boolean representation of the value.
|
boolean |
comparable(Item it)
Checks if the items can be compared.
|
double |
dbl(InputInfo ii)
Returns a double representation of the value.
|
BigDecimal |
dec(InputInfo ii)
Returns a decimal representation of the value.
|
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 qc,
InputInfo ii)
Checks if the effective boolean value can be computed for this expression:
If it yields an empty sequence,
Bln.FALSE will be returned. |
abstract boolean |
eq(Item it,
Collation coll,
StaticContext sc,
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.
|
Item |
item(QueryContext qc,
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()
Indicates if the items returned by this expression are iterable, i.e., if returned nodes are
in document order and contain no duplicates.
|
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 (do not assign if value is 0).
|
SeqType |
seqType()
Returns the static type of the resulting value.
|
long |
size()
Returns the sequence size or 1.
|
abstract byte[] |
string(InputInfo ii)
Returns a string representation of the value.
|
Item |
test(QueryContext qc,
InputInfo ii)
Performs a predicate test and returns the item the if test was successful.
|
Type.ID |
typeId()
Returns a type id.
|
int |
writeTo(Item[] arr,
int index)
Writes this value's items out to the given array.
|
byte[] |
xdmInfo()
Returns data model info.
|
accept, atomValue, cache, checkUp, compile, copy, count, exprSize, has, inline, isValue, iter, iterator, removable, serialize, serialize, toJava, value
atomIter, data, hasFreeVars, indexAccessible, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, optimizeEbv, sameAs, typeCheck, uses, visitAll
public static final int UNDEF
protected Double score
null
reference takes less memory on 32bit than a double.protected Item(Type type)
type
- item typepublic final Item item(QueryContext qc, InputInfo ii)
Expr
null
reference if the expression yields an empty sequence.
If this method is not overwritten, Expr.iter(QueryContext)
must be implemented by an
expression, as it may be called by this method.public final Item itemAt(long pos)
Value
public final Item ebv(QueryContext qc, InputInfo ii)
Expr
Checks if the effective boolean value can be computed for this expression:
Bln.FALSE
will be returned.
A single numeric item may later be evaluated as positional predicate.
public Item test(QueryContext qc, InputInfo ii) throws QueryException
Expr
test
in class Expr
qc
- query contextii
- input infoQueryException
- query exceptionpublic abstract byte[] string(InputInfo ii) throws QueryException
ii
- input info, use null
if none is availableQueryException
- if the item can't be atomizedpublic boolean bool(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic BigDecimal dec(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic long itr(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic float flt(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic double dbl(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic final boolean comparable(Item it)
it
- item to be comparedpublic abstract boolean eq(Item it, Collation coll, StaticContext sc, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- collationsc
- static contextii
- input infoQueryException
- query exceptionpublic final boolean equiv(Item it, Collation coll, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- collationii
- input infoQueryException
- query exceptionpublic int diff(Item it, Collation coll, InputInfo ii) throws QueryException
it
- item to be comparedcoll
- query contextii
- input infoQueryException
- query exceptionpublic BufferInput input(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic Item materialize(InputInfo ii) throws QueryException
Value
materialize
in class Value
ii
- input infoQueryException
- query exceptionpublic Value atomValue(InputInfo ii) throws QueryException
Value
atomValue
in class Value
ii
- input infoQueryException
- query exceptionpublic final Item atomItem(QueryContext qc, InputInfo ii) throws QueryException
Expr
atomItem
in class Expr
qc
- query contextii
- input infoQueryException
- query exceptionpublic Item atomItem(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic long atomSize()
Value
public final SeqType seqType()
Expr
public final long size()
Expr
public final boolean iterable()
Expr
AxisPath
.public double score()
public final void score(double s)
s
- score valuepublic String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.description
in class Value
public void plan(FElem plan)
ExprInfo
public int hash(InputInfo ii) throws QueryException
Value
hash
in class Value
ii
- input infoQueryException
- if atomization can't be applied (e.g. function item)public final int writeTo(Item[] arr, int index)
Value
public final boolean homogeneous()
Value
homogeneous
in class Value
public byte[] xdmInfo()
public Type.ID typeId()
Copyright © 2005–2015 BaseX Team. All rights reserved.