org.modeshape.common.math

## Class Duration.Components

- java.lang.Object
- - org.modeshape.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.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Duration.Components(int hours, int minutes, double seconds)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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` | `toSimpleString()` Return the duration as a string in a form containing hours, minutes, and seconds, excluding the fractional part of the seconds.
    `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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Duration.Components

          protected Duration.Components(int hours,
                             int minutes,
                             double seconds)

  - ### 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

    - #### toSimpleString

          public String toSimpleString()

      Return the duration as a string in a form containing hours, minutes, and seconds, excluding 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")
      Returns:
        a simple string representation of the duration components

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