Package org.basex.query.value.item
Class ANum
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.expr.Expr
org.basex.query.value.Value
org.basex.query.value.item.Item
org.basex.query.value.item.ANum
Abstract super class for all numeric items.
Useful for removing exceptions and unifying hash values.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ANumabs()Returns an absolute value.abstract ANumceiling()Returns an ceiling value.final booleancomparable(Item item) Checks if the items can be compared.abstract doubledbl()Returns an double representation of the value.final doubleReturns a double representation of the value.abstract ANumfloor()Returns an floor value.protected abstract floatflt()Returns an float representation of the value.final floatReturns a float representation of the value.final intReturns a hash code for this value.abstract longitr()Returns an integer (long) representation of the value.final longReturns an integer (long) representation of the value.final voidplan(QueryString qs) Creates a query string.abstract ANumround(int scale, boolean even) Returns a rounded value.booleanCompares the items for equality.final ExprsimplifyFor(CompileContext.Simplify mode, CompileContext cc) This function is called at compile time for expressions whose operands might be simplified.protected abstract byte[]string()Returns a string representation of the value.final byte[]Returns a string representation of the value.test(QueryContext qc, InputInfo ii) Performs a predicate test and returns the item if the test was successful.Methods inherited from class org.basex.query.value.item.Item
atomItem, atomSize, atomValue, bool, cache, ddo, dec, description, diff, ebv, eq, equiv, input, instanceOf, item, itemAt, iter, materialize, persistent, plan, refineType, reverse, score, seqType, size, subsequence, typeId, xdmInfoMethods inherited from class org.basex.query.value.Value
accept, checkUp, compile, copy, count, exprSize, has, inline, inlineable, isEmpty, isItem, iter, iterator, materialize, serialize, serialize, serialize, toJava, valueMethods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, data, equals, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, typeCheck, uses, vacuous, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
string
Description copied from class:ItemReturns a string representation of the value. -
dbl
Description copied from class:ItemReturns a double representation of the value. -
itr
Description copied from class:ItemReturns an integer (long) representation of the value. -
flt
Description copied from class:ItemReturns a float representation of the value. -
sameKey
Description copied from class:ItemCompares the items for equality.- Overrides:
sameKeyin classItem- Parameters:
item- item to be comparedii- input info (can benull)- Returns:
- result of check
- Throws:
QueryException- query exception
-
string
protected 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
protected abstract float flt()Returns an float representation of the value.- Returns:
- float value
-
abs
Returns an absolute value.- Returns:
- absolute value
-
ceiling
Returns an ceiling value.- Returns:
- ceiling value
-
floor
Returns an floor value.- Returns:
- floor value
-
round
Returns a rounded value.- Parameters:
scale- scaleeven- half-to-even flag- Returns:
- rounded value
-
comparable
Description copied from class:ItemChecks if the items can be compared.- Overrides:
comparablein classItem- Parameters:
item- item to be compared- Returns:
- result of check
-
test
Description copied from class:ExprPerforms a predicate test and returns the item if the test was successful. The returned item is required for full-text scoring. -
simplifyFor
Description copied from class:ExprThis function is called at compile time for expressions whose operands might be simplified.- Overrides:
simplifyForin classExpr- Parameters:
mode- mode of simplificationcc- compilation context- Returns:
- simplified or original expression
- See Also:
-
hash
Description copied from class:ValueReturns a hash code for this value. -
plan
Description copied from class:ExprInfoCreates a query string.
-