org.basex.query.item
Class Dur

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.item.Item
              extended by org.basex.query.item.Dur
Direct Known Subclasses:
DTd, YMd

public class Dur
extends Item

Duration item.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Use
 
Field Summary
 
Fields inherited from class org.basex.query.item.Item
score, type
 
Constructor Summary
Dur(byte[] v)
          Constructor.
Dur(byte[] v, Type t)
          Constructor.
Dur(Dur d)
          Constructor.
Dur(Dur d, Type t)
          Constructor.
 
Method Summary
 long day()
          Returns the days.
 int diff(Item it)
          Returns the difference between the current and the specified item.
 boolean eq(Item it)
          Checks the items for equality.
 int hashCode()
           
 long hou()
          Returns the hours.
 Duration java()
          Returns a Java object.
 long min()
          Returns the minutes.
 int mon()
          Returns the months.
 BigDecimal sec()
          Returns the seconds.
 byte[] str()
          Returns an atomized string.
 long tim()
          Returns the time.
 String toString()
           
 int yea()
          Returns the years.
 
Methods inherited from class org.basex.query.item.Item
atomic, bool, comp, d, dbl, dec, duplicates, ebv, flt, i, iter, iter, itr, n, name, node, plan, removable, returned, s, score, score, serialize, size, test, u, uses
 
Methods inherited from class org.basex.query.expr.Expr
addText, checkCtx, checkDbl, checkItr, e, indexAccessible, indexEquivalent, remove, sameAs, v
 
Methods inherited from class org.basex.query.ExprInfo
color, info
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dur

public Dur(Dur d,
           Type t)
Constructor.

Parameters:
d - duration
t - data type

Dur

public Dur(Dur d)
Constructor.

Parameters:
d - duration

Dur

public Dur(byte[] v)
    throws QueryException
Constructor.

Parameters:
v - value
Throws:
QueryException - query exception

Dur

public Dur(byte[] v,
           Type t)
    throws QueryException
Constructor.

Parameters:
v - value
t - data type
Throws:
QueryException - query exception
Method Detail

yea

public final int yea()
Returns the years.

Returns:
year

mon

public final int mon()
Returns the months.

Returns:
year

day

public final long day()
Returns the days.

Returns:
day

tim

public final long tim()
Returns the time.

Returns:
time

hou

public final long hou()
Returns the hours.

Returns:
day

min

public final long min()
Returns the minutes.

Returns:
day

sec

public final BigDecimal sec()
Returns the seconds.

Returns:
day

str

public byte[] str()
Description copied from class: Item
Returns an atomized string.

Overrides:
str in class Item
Returns:
string representation

eq

public final boolean eq(Item it)
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
it - item to be compared
Returns:
result of check

diff

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

Overrides:
diff in class Item
Parameters:
it - item to be compared
Returns:
difference
Throws:
QueryException - query exception

java

public final Duration java()
Description copied from class: Item
Returns a Java object.

Overrides:
java in class Item
Returns:
string representation

hashCode

public int hashCode()
Overrides:
hashCode in class Item

toString

public final String toString()
Overrides:
toString in class Item