Package org.basex.query.value.item
Class Atm
- 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.Atm
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bool(InputInfo ii)
Returns a boolean representation of the value.boolean
comparable(Item item)
Checks if the items can be compared.int
compare(Item item, Collation coll, boolean transitive, InputInfo ii)
Compares the current and the specified item.boolean
deepEqual(Item item, DeepEqual deep)
Compares items for deep equality.boolean
equal(Item item, Collation coll, InputInfo ii)
Compares items for equality.boolean
equals(Object obj)
This function is e.g.static Atm
get(byte[] value)
Returns an instance of this class.static Atm
get(String value)
Returns an instance of this class.int
hash()
Returns a hash code for an atomic item.Expr
simplifyFor(CompileContext.Simplify mode, CompileContext cc)
Simplifies the expression.byte[]
string(InputInfo ii)
Returns a string representation of the value.String
toJava()
Returns a Java representation of the value.void
toString(QueryString qs)
Creates a query string.-
Methods inherited from class org.basex.query.value.item.Item
atomicEqual, atomItem, atomValue, cache, dbl, ddo, dec, description, flt, input, instanceOf, isItem, item, itemAt, iter, itr, materialize, materialized, refineType, refineType, reverse, sameType, score, seqType, size, stringInput, subsequence, test, toXml, typeId, write, xdmInfo
-
Methods inherited from class org.basex.query.value.Value
accept, checkUp, compile, copy, count, exprSize, has, inline, inlineable, isEmpty, iter, iterator, refineType, serialize, serialize, serialize, value
-
Methods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, funcType, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, mergeEbv, optimize, optimizePos, simplify, typeCheck, uses, vacuous, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
info, toErrorString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
EMPTY
public static final Atm EMPTY
Zero-length atomic item.
-
-
Method Detail
-
get
public static Atm get(String value)
Returns an instance of this class.- Parameters:
value
- value- Returns:
- instance
-
get
public static Atm get(byte[] value)
Returns an instance of this class.- Parameters:
value
- value- Returns:
- instance
-
string
public byte[] string(InputInfo ii)
Description copied from class:Item
Returns a string representation of the value.
-
hash
public int hash()
Description copied from class:Item
Returns a hash code for an atomic item. The returned values must be suitable for comparison according to the deep-equal rules.
-
bool
public boolean bool(InputInfo ii)
Description copied from class:Item
Returns a boolean representation of the value.
-
comparable
public boolean comparable(Item item)
Description copied from class:Item
Checks if the items can be compared.- Overrides:
comparable
in classItem
- Parameters:
item
- item to be compared- Returns:
- result of check
-
equal
public boolean equal(Item item, Collation coll, InputInfo ii) throws QueryException
Description copied from class:Item
Compares items for equality. Called byCmpV.OpV
.- Specified by:
equal
in classItem
- Parameters:
item
- item to be comparedcoll
- collation (can benull
)ii
- input info (can benull
)- Returns:
- result of check
- Throws:
QueryException
- query exception
-
deepEqual
public boolean deepEqual(Item item, DeepEqual deep) throws QueryException
Description copied from class:Item
Compares items for deep equality. Called byDeepEqual
.- Overrides:
deepEqual
in classItem
- Parameters:
item
- item to be compareddeep
- comparator- Returns:
- result of check
- Throws:
QueryException
- query exception
-
compare
public int compare(Item item, Collation coll, boolean transitive, InputInfo ii) throws QueryException
Description copied from class:Item
Compares the current and the specified item.- Overrides:
compare
in classItem
- Parameters:
item
- item to be comparedcoll
- collation (can benull
)transitive
- transitive comparisonii
- input info (can benull
)- Returns:
- difference
- Throws:
QueryException
- query exception
-
simplifyFor
public Expr simplifyFor(CompileContext.Simplify mode, CompileContext cc) throws QueryException
Description copied from class:Expr
Simplifies the expression. Overwritten by many expressions; callsExpr.simplify(Simplify, CompileContext)
otherwise.- Overrides:
simplifyFor
in classExpr
- Parameters:
mode
- mode of simplificationcc
- compilation context- Returns:
- simplified or original expression
- Throws:
QueryException
- query exception- See Also:
CompileContext.Simplify
-
equals
public boolean equals(Object obj)
Description copied from class:Expr
This 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)
, in order to compare the start and end value.PathCache
, in order to find identical root values at runtime.
-
toJava
public String toJava()
Description copied from class:Value
Returns a Java representation of the value.
-
toString
public void toString(QueryString qs)
Description copied from class:ExprInfo
Creates a query string.
-
-