org.basex.query.xquery.item
Class Dur

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

public class Dur
extends Item

Duration item.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.xquery.expr.Expr
Expr.Return, Expr.Using
 
Field Summary
 
Fields inherited from class org.basex.query.xquery.item.Item
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 hash()
          Returns a hash code.
 long hou()
          Returns the hours.
 javax.xml.datatype.Duration java()
          Returns a Java object.
 long min()
          Returns the minutes.
 int mon()
          Returns the months.
 java.math.BigDecimal sec()
          Returns the seconds.
 byte[] str()
          Returns an atomized string.
 long tim()
          Returns the time.
 java.lang.String toString()
           
 int yea()
          Returns the years.
 
Methods inherited from class org.basex.query.xquery.item.Item
bool, castErr, comp, d, dbl, dec, flt, i, iter, iter, itr, n, name, node, plan, returned, s, score, score, serialize, size, u, uses
 
Methods inherited from class org.basex.query.xquery.expr.Expr
e
 
Methods inherited from class org.basex.query.ExprInfo
color, info
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, 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 XQException
Constructor.

Parameters:
v - value
Throws:
XQException - evaluation exception

Dur

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

Parameters:
v - value
t - data type
Throws:
XQException - evaluation exception
Method Detail

yea

public int yea()
Returns the years.

Returns:
year

mon

public int mon()
Returns the months.

Returns:
year

day

public long day()
Returns the days.

Returns:
day

tim

public long tim()
Returns the time.

Returns:
time

hou

public long hou()
Returns the hours.

Returns:
day

min

public long min()
Returns the minutes.

Returns:
day

sec

public java.math.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

hash

public int hash()
Description copied from class: Item
Returns a hash code.

Overrides:
hash in class Item
Returns:
hash code

eq

public 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 XQException
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:
XQException - evaluation exception

java

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

Overrides:
java in class Item
Returns:
string representation

toString

public final java.lang.String toString()
Overrides:
toString in class Item