API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.xml.datatype. Duration View Source
Author(s)
Joseph Fialli
Kohsuke Kawaguchi
Jeff Suttor
Sunitha Reddy
Since
1.5
Version
$Revision: 1.7 $, $Date: 2006/01/12 18:49:19 $
Serial
Hierarchy
 Object
      Duration
Implements
Subclasses
Description
publicabstract abstract class Duration
  Immutable representation of a time span as defined in the W3C XML Schema 1.0 specification.
Constructors
public Duration ()
  Default no-arg constructor.
Methods
Hide/Show inherited methods
publicabstract Duration add (Duration rhs)
  Computes a new duration whose value is this+rhs.
publicabstract void addTo (Calendar calendar)
  Adds this duration to a Calendar object.
public void addTo (Date date)
  Adds this duration to a Date object.
publicabstract int compare (Duration duration)
  Partial order relation comparison with this Duration instance.
public boolean equals (Object duration)
  Checks if this duration object has the same duration as another Duration object.
public int getDays ()
  Obtains the value of the DAYS field as an integer value, or 0 if not present.
publicabstract Number getField (Field field)
  Gets the value of a field.
public int getHours ()
  Obtains the value of the HOURS field as an integer value, or 0 if not present.
public int getMinutes ()
  Obtains the value of the MINUTES field as an integer value, or 0 if not present.
public int getMonths ()
  Obtains the value of the MONTHS field as an integer value, or 0 if not present.
public int getSeconds ()
  Obtains the value of the SECONDS field as an integer value, or 0 if not present.
publicabstract int getSign ()
  Returns the sign of this duration in -1,0, or 1.
public long getTimeInMillis (Calendar startInstant)
  Returns the length of the duration in milli-seconds.
public long getTimeInMillis (Date startInstant)
  Returns the length of the duration in milli-seconds.
public QName getXMLSchemaType ()
  Return the name of the XML Schema date/time type that this instance maps to.
public int getYears ()
  Get the years value of this Duration as an int or 0 if not present.
publicabstract int hashCode ()
  Returns a hash code consistent with the definition of the equals method.
public boolean isLongerThan (Duration duration)
  Checks if this duration object is strictly longer than another Duration object.
publicabstract boolean isSet (Field field)
  Checks if a field is set.
public boolean isShorterThan (Duration duration)
  Checks if this duration object is strictly shorter than another Duration object.
publicabstract Duration multiply (BigDecimal factor)
  Computes a new duration whose value is factor times longer than the value of this duration.
public Duration multiply (int factor)
  Computes a new duration whose value is factor times longer than the value of this duration.
publicabstract Duration negate ()
  Returns a new Duration object whose value is -this.
publicabstract Duration normalizeWith (Calendar startTimeInstant)
  Converts the years and months fields into the days field by using a specific time instant as the reference point.
public Duration subtract (Duration rhs)
  Computes a new duration whose value is this-rhs.
public String toString ()
  Returns a String representation of this Duration Object.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar