Package org.basex.query.value.item
Class DTDur
DayTime Duration item (
xs:dayTimeDuration).- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DTDur(long hours, long minutes) Constructor.DTDur(BigDecimal sec) Constructor.Constructor for subtracting two date/time items.Constructor for adding two durations.Constructor.Constructor for multiplying a duration with a number. -
Method Summary
Methods inherited from class org.basex.query.value.item.Dur
comparable, day, eq, equals, hash, hour, minute, mon, plan, sec, toJava, yeaMethods inherited from class org.basex.query.value.item.Item
atomItem, atomSize, atomValue, bool, cache, dbl, ddo, dec, description, ebv, equiv, flt, input, instanceOf, item, itemAt, iter, itr, materialize, persistent, plan, refineType, reverse, sameKey, 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
-
Constructor Details
-
DTDur
Constructor.- Parameters:
dur- duration item
-
DTDur
public DTDur(long hours, long minutes) Constructor.- Parameters:
hours- hoursminutes- minutes
-
DTDur
Constructor.- Parameters:
sec- seconds
-
DTDur
Constructor.- Parameters:
value- valueii- input info- Throws:
QueryException- query exception
-
DTDur
Constructor for adding two durations.- Parameters:
dur- duration itemadd- duration to be added/subtractedplus- plus/minus flagii- input info- Throws:
QueryException- query exception
-
DTDur
Constructor for multiplying a duration with a number.- Parameters:
dur- duration itemfactor- factormult- multiplication flagii- input info- Throws:
QueryException- query exception
-
DTDur
Constructor for subtracting two date/time items.- Parameters:
date- date itemsub- date/time to be subtractedii- input info- Throws:
QueryException- query exception
-
-
Method Details
-
dtd
Returns the date and time.- Returns:
- year
-
string
Description copied from class:ItemReturns a string representation of the 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 classDur- Parameters:
item- item to be comparedcoll- collation (can benull)ii- input info (can benull)- Returns:
- difference
- Throws:
QueryException- query exception
-
get
Returns a dayTimeDuration item for the specified milliseconds.- Parameters:
ms- milliseconds- Returns:
- dateTime instance
-