org.basex.query.value.item
Class DTDur

java.lang.Object
  extended by org.basex.data.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.value.Value
              extended by org.basex.query.value.item.Item
                  extended by org.basex.query.value.item.ADateDur
                      extended by org.basex.query.value.item.Dur
                          extended by org.basex.query.value.item.DTDur
All Implemented Interfaces:
java.lang.Iterable<Item>

public final class DTDur
extends Dur

DayTime Duration item (xs:dayTimeDuration).

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Flag
 
Field Summary
 
Fields inherited from class org.basex.query.value.item.Dur
DP
 
Fields inherited from class org.basex.query.value.item.ADateDur
BD100, BD1000, BD146097, BD1461, BD153, BD2, BD3600, BD365, BD36524, BD36525, BD366, BD4, BD5, BD60, BDMAXLONG, DAYSECONDS, sec
 
Fields inherited from class org.basex.query.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Constructor Summary
DTDur(ADate dat, ADate sub, InputInfo ii)
          Constructor.
DTDur(byte[] vl, InputInfo ii)
          Constructor.
DTDur(DTDur it, DTDur a, boolean p, InputInfo ii)
          Constructor.
DTDur(Dur d)
          Constructor.
DTDur(Dur it, double f, boolean m, InputInfo ii)
          Constructor.
DTDur(long ms)
          Timezone constructor.
DTDur(long h, long m)
          Timezone constructor.
 
Method Summary
 int diff(Item it, Collation coll, InputInfo ii)
          Returns the difference between the current and the specified item.
 java.math.BigDecimal dtd()
          Returns the date and time.
 byte[] string(InputInfo ii)
          Returns a string representation of the value.
 
Methods inherited from class org.basex.query.value.item.Dur
date, day, dayTime, eq, hash, hou, min, mon, sec, time, toJava, toString, yea, yearMonth
 
Methods inherited from class org.basex.query.value.item.ADateDur
dateErr, toDecimal, toLong
 
Methods inherited from class org.basex.query.value.item.Item
bool, castErr, comparable, dbl, dec, description, ebv, equiv, flt, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, plan, score, score, size, test, type, typeId, writeTo, xdmInfo
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DTDur

public DTDur(Dur d)
Constructor.

Parameters:
d - duration item

DTDur

public DTDur(long h,
             long m)
Timezone constructor.

Parameters:
h - hours
m - minutes

DTDur

public DTDur(long ms)
Timezone constructor.

Parameters:
ms - milliseconds

DTDur

public DTDur(DTDur it,
             DTDur a,
             boolean p,
             InputInfo ii)
      throws QueryException
Constructor.

Parameters:
it - duration item
a - duration to be added/subtracted
p - plus/minus flag
ii - input info
Throws:
QueryException - query exception

DTDur

public DTDur(Dur it,
             double f,
             boolean m,
             InputInfo ii)
      throws QueryException
Constructor.

Parameters:
it - duration item
f - factor
m - multiplication flag
ii - input info
Throws:
QueryException - query exception

DTDur

public DTDur(ADate dat,
             ADate sub,
             InputInfo ii)
      throws QueryException
Constructor.

Parameters:
dat - date item
sub - date to be subtracted
ii - input info
Throws:
QueryException - query exception

DTDur

public DTDur(byte[] vl,
             InputInfo ii)
      throws QueryException
Constructor.

Parameters:
vl - value
ii - input info
Throws:
QueryException - query exception
Method Detail

dtd

public java.math.BigDecimal dtd()
Returns the date and time.

Returns:
year

string

public byte[] string(InputInfo ii)
Description copied from class: Item
Returns a string representation of the value.

Overrides:
string in class Dur
Parameters:
ii - input info, use null if none is available
Returns:
string value

diff

public int diff(Item it,
                Collation coll,
                InputInfo ii)
         throws QueryException
Description copied from class: Item
Returns the difference between the current and the specified item.

Overrides:
diff in class Dur
Parameters:
it - item to be compared
coll - query context
ii - input info
Returns:
difference
Throws:
QueryException - query exception