Package org.basex.query.value.item
Class ADate
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.ADateDur
org.basex.query.value.item.ADate
Abstract super class for date items.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal longday()Returns the days.intReturns the difference between the current and the specified item.static intdpm(long yea, int mon) Returns days per month, considering leap years.final booleaneq(Item item, Collation coll, StaticContext sc, InputInfo ii) Compares the items for equality.final booleanThis function is e.g.final intReturns a hash code for this value.final booleanhasTz()Returns if the timezone is defined.final longhour()Returns the hours (0-23).final longminute()Returns the minutes (0-59).final longmon()Returns the months.final voidplan(QueryString qs) Creates a query string.final booleanCompares the items for equality.final BigDecimalsec()Returns the seconds (0-59), including the fractional part.final BigDecimalseconds()Returns the date in seconds.byte[]Returns a string representation of the value.abstract voidAdjusts the timezone.final XMLGregorianCalendartoJava()Returns a Java representation of the value.final inttz()Returns the timezone in minutes.final longyea()Returns the years.Methods inherited from class org.basex.query.value.item.Item
atomItem, atomSize, atomValue, bool, cache, comparable, dbl, ddo, dec, description, ebv, equiv, flt, input, instanceOf, item, itemAt, iter, itr, materialize, persistent, plan, refineType, reverse, score, seqType, size, subsequence, test, 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, simplifyFor, 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
-
DATE
Date pattern. -
TIME
Time pattern.
-
-
Method Details
-
timeZone
Adjusts the timezone.- Parameters:
zone- timezone (may benull)spec- indicates if zone has been specifiedii- input info- Throws:
QueryException- query exception
-
yea
public final long yea()Description copied from class:ADateDurReturns the years. -
mon
public final long mon()Description copied from class:ADateDurReturns the months. -
day
public final long day()Description copied from class:ADateDurReturns the days. -
hour
public final long hour()Description copied from class:ADateDurReturns the hours (0-23). -
minute
public final long minute()Description copied from class:ADateDurReturns the minutes (0-59). -
sec
Description copied from class:ADateDurReturns the seconds (0-59), including the fractional part. -
tz
public final int tz()Returns the timezone in minutes.- Returns:
- time zone
-
hasTz
public final boolean hasTz()Returns if the timezone is defined.- Returns:
- time zone
-
string
Description copied from class:ItemReturns a string representation of the value. -
eq
public final boolean eq(Item item, Collation coll, StaticContext sc, InputInfo ii) throws QueryException 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
-
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
-
hash
Description copied from class:ValueReturns a hash code for this value. -
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. -
seconds
Returns the date in seconds.- Returns:
- seconds
-
dpm
public static int dpm(long yea, int mon) Returns days per month, considering leap years.- Parameters:
yea- yearmon- month- Returns:
- days
-
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.
-
plan
Description copied from class:ExprInfoCreates a query string.
-