Package org.basex.query.value.item
Class Int
Integer item (
xs:int, xs:integer, xs:short, etc.).- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()Returns an absolute value.booleanReturns a boolean representation of the value.ceiling()Returns an ceiling value.doubledbl()Returns an double representation of the value.Returns a decimal representation of the value.intReturns the difference between the current and the specified item.booleaneq(Item item, Collation coll, StaticContext sc, InputInfo ii) Compares the items for equality.booleanThis function is e.g.floor()Returns an floor value.floatflt()Returns an float representation of the value.static Intget(long value) Returns an instance of this class.static IntReturns an instance of this class.longitr()Returns an integer (long) representation of the value.static longConverts the given item to a long primitive.round(int scale, boolean even) Returns a rounded value.byte[]string()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.toJava()Returns a Java representation of the value.Methods inherited from class org.basex.query.value.item.ANum
comparable, dbl, flt, hash, itr, plan, sameKey, simplifyFor, stringMethods inherited from class org.basex.query.value.item.Item
atomItem, atomSize, atomValue, cache, ddo, description, ebv, 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, valueMethods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, data, 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
-
Field Details
-
MAX
Maximum values. -
ZERO
Value 0. -
ONE
Value 1.
-
-
Constructor Details
-
Int
Constructor.- Parameters:
value- valuetype- item type
-
-
Method Details
-
get
Returns an instance of this class.- Parameters:
value- value- Returns:
- instance
-
get
Returns an instance of this class.- Parameters:
value- valuetype- item type- Returns:
- instance
-
string
public byte[] string()Description copied from class:ANumReturns a string representation of the value. -
bool
Description copied from class:ItemReturns a boolean representation of the value. -
itr
public long itr()Description copied from class:ANumReturns an integer (long) representation of the value. -
flt
public float flt()Description copied from class:ANumReturns an float representation of the value. -
dbl
public double dbl()Description copied from class:ANumReturns an double representation of the value. -
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. -
dec
Description copied from class:ItemReturns a decimal representation of the value. -
abs
Description copied from class:ANumReturns an absolute value. -
ceiling
Description copied from class:ANumReturns an ceiling value. -
floor
Description copied from class:ANumReturns an floor value. -
round
Description copied from class:ANumReturns a rounded value. -
eq
Description copied from class:ItemCompares the items for equality.- Specified by:
eqin classItem- Parameters:
item- item to be comparedcoll- collation (can benull)sc- static context; required for comparing items of type xs:QName (can benull)ii- input info (can benull)- Returns:
- result of check
- Throws:
QueryException- query exception
-
diff
Description copied from class:ItemReturns the difference between the current and the specified item. This function is overwritten by the corresponding implementations.- Overrides:
diffin classItem- Parameters:
item- item to be comparedcoll- collation (can benull)ii- input info (can benull)- Returns:
- difference
- Throws:
QueryException- query exception
-
toJava
Description copied from class:ValueReturns a Java representation of the value. -
equals
Description copied from class:ExprThis function is e.g. called by:If.optimize(CompileContext),Switch.optimize(CompileContext),Typeswitch.optimize(CompileContext), in order to discard identical expressions.CmpR.mergeEbv(Expr, boolean, CompileContext)orCmpSR.mergeEbv(Expr, boolean, CompileContext), in order to merge expressions with identical input.CmpG.optimize(CompileContext)orCmpV.optimize(CompileContext), in order to pre-evaluate equality tests.CmpG.optimize(CompileContext)orPos.get(Expr, CmpV.OpV, InputInfo, CompileContext), in order to compare the start and end value.PathCache, in order to find identical root values at runtime.
-
parse
Converts the given item to a long primitive.- Parameters:
item- item to be convertedii- input info- Returns:
- long value
- Throws:
QueryException- query exception
-