org.jscience.history.time
Class ModernTime

java.lang.Object
  extended by org.jscience.history.time.Time
      extended by org.jscience.history.time.ModernTime

public class ModernTime
extends Time

A class representing a way to compute time.


Field Summary
static Unit<Duration> DAYS_HOURS_MINUTES_SECONDS_MILLIS
          DOCUMENT ME!
static int HOURS_PER_DAY
          DOCUMENT ME!
static int MILLISECONDS_PER_SECOND
          DOCUMENT ME!
static int MINUTES_PER_HOUR
          DOCUMENT ME!
static Unit<Duration> MODERN_DAY
          A unit of duration equal to 24 MODERN_HOUR (standard name d).
static Unit<Duration> MODERN_HOUR
          A unit of duration equal to 60 MODERN_MINUTE (standard name h).
static Unit<Duration> MODERN_MILLISECOND
          A unit of duration equal to 1/1000 s (standard name ms).
static Unit<Duration> MODERN_MINUTE
          A unit of duration equal to 60 s (standard name min).
static BaseUnit<Duration> MODERN_SECOND
          The base unit for duration quantities (s).
static int SECONDS_PER_MINUTE
          DOCUMENT ME!
 
Constructor Summary
ModernTime()
          Creates a new ModernTime object.
ModernTime(double millis)
          Creates a new ModernTime object.
ModernTime(double days, double hours, double minutes, double seconds, double millis)
          Creates a new ModernTime object.
 
Method Summary
 int getDays()
          DOCUMENT ME!
 int getHours()
          DOCUMENT ME!
 int getMilliseconds()
          DOCUMENT ME!
 int getMinutes()
          DOCUMENT ME!
 int getSeconds()
          DOCUMENT ME!
 Amount<Duration> getTime()
          DOCUMENT ME!
 double getTimeInSeconds()
          DOCUMENT ME!
 boolean is24()
          DOCUMENT ME!
 void nextDay()
          DOCUMENT ME!
 void nextHour()
          DOCUMENT ME!
 void nextMillisecond()
          DOCUMENT ME!
 void nextMinute()
          DOCUMENT ME!
 void nextSecond()
          DOCUMENT ME!
 void set24(boolean is24)
          DOCUMENT ME!
 java.util.Calendar toCalendar()
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HOURS_PER_DAY

public static final int HOURS_PER_DAY
DOCUMENT ME!

See Also:
Constant Field Values

MINUTES_PER_HOUR

public static final int MINUTES_PER_HOUR
DOCUMENT ME!

See Also:
Constant Field Values

SECONDS_PER_MINUTE

public static final int SECONDS_PER_MINUTE
DOCUMENT ME!

See Also:
Constant Field Values

MILLISECONDS_PER_SECOND

public static final int MILLISECONDS_PER_SECOND
DOCUMENT ME!

See Also:
Constant Field Values

MODERN_MILLISECOND

public static final Unit<Duration> MODERN_MILLISECOND
A unit of duration equal to 1/1000 s (standard name ms).


MODERN_SECOND

public static final BaseUnit<Duration> MODERN_SECOND
The base unit for duration quantities (s). It is defined as the duration of 9,192,631,770 cycles of radiation corresponding to the transition between two hyperfine levels of the ground state of cesium (1967 Standard).


MODERN_MINUTE

public static final Unit<Duration> MODERN_MINUTE
A unit of duration equal to 60 s (standard name min).


MODERN_HOUR

public static final Unit<Duration> MODERN_HOUR
A unit of duration equal to 60 MODERN_MINUTE (standard name h).


MODERN_DAY

public static final Unit<Duration> MODERN_DAY
A unit of duration equal to 24 MODERN_HOUR (standard name d).


DAYS_HOURS_MINUTES_SECONDS_MILLIS

public static final Unit<Duration> DAYS_HOURS_MINUTES_SECONDS_MILLIS
DOCUMENT ME!

Constructor Detail

ModernTime

public ModernTime(double days,
                  double hours,
                  double minutes,
                  double seconds,
                  double millis)
Creates a new ModernTime object.


ModernTime

public ModernTime(double millis)
Creates a new ModernTime object.

Parameters:
millis - DOCUMENT ME!

ModernTime

public ModernTime()
Creates a new ModernTime object.

Method Detail

getTime

public Amount<Duration> getTime()
DOCUMENT ME!

Specified by:
getTime in class Time
Returns:
DOCUMENT ME!

getTimeInSeconds

public double getTimeInSeconds()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getMilliseconds

public int getMilliseconds()
DOCUMENT ME!

Specified by:
getMilliseconds in class Time
Returns:
DOCUMENT ME!

getSeconds

public int getSeconds()
DOCUMENT ME!

Specified by:
getSeconds in class Time
Returns:
DOCUMENT ME!

getMinutes

public int getMinutes()
DOCUMENT ME!

Specified by:
getMinutes in class Time
Returns:
DOCUMENT ME!

getHours

public int getHours()
DOCUMENT ME!

Specified by:
getHours in class Time
Returns:
DOCUMENT ME!

getDays

public int getDays()
DOCUMENT ME!

Specified by:
getDays in class Time
Returns:
DOCUMENT ME!

nextMillisecond

public void nextMillisecond()
DOCUMENT ME!

Specified by:
nextMillisecond in class Time

nextSecond

public void nextSecond()
DOCUMENT ME!

Specified by:
nextSecond in class Time

nextMinute

public void nextMinute()
DOCUMENT ME!

Specified by:
nextMinute in class Time

nextHour

public void nextHour()
DOCUMENT ME!

Specified by:
nextHour in class Time

nextDay

public void nextDay()
DOCUMENT ME!

Specified by:
nextDay in class Time

is24

public boolean is24()
DOCUMENT ME!

Returns:
DOCUMENT ME!

set24

public void set24(boolean is24)
DOCUMENT ME!

Parameters:
is24 - DOCUMENT ME!

toCalendar

public java.util.Calendar toCalendar()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Specified by:
toString in class Time
Returns:
DOCUMENT ME!