org.jboss.dna.common.math
Class Duration.Components

java.lang.Object
  extended by org.jboss.dna.common.math.Duration.Components
Enclosing class:
Duration

public class Duration.Components
extends Object

The atomic components of this duration, broken down into whole hours, minutes and (fractional) seconds.


Method Summary
 int getHours()
          Get the whole hours in this duration.
 int getMinutes()
          Get the whole minutes in this duration.
 double getSeconds()
          Get the duration's seconds component.
 String toString()
          Return the duration as a string in a form containing hours, minutes, and seconds, including the fractional part of the seconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getHours

public int getHours()
Get the whole hours in this duration.

Returns:
the hours

getMinutes

public int getMinutes()
Get the whole minutes in this duration.

Returns:
the minutes, from 0 to 59.

getSeconds

public double getSeconds()
Get the duration's seconds component.

Returns:
the number of seconds, including fractional part.

toString

public String toString()
Return the duration as a string in a form containing hours, minutes, and seconds, including the fractional part of the seconds. The format is essentially HHH:MM:SS.mmm, where
HHH
is the number of hours written in at least 2 digits (e.g., "03")
MM
is the number of hours written in at least 2 digits (e.g., "03")
SS
is the number of hours written in at least 2 digits (e.g., "03")
mmm
is the fractional part of seconds, written with 3-6 digits (any trailing zeros are dropped)

Overrides:
toString in class Object
Returns:
a string representation of the duration components


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.