|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.datatypes.Time
public class Time
Defines a datatype for time based on seconds.
| Field Summary | |
|---|---|
private double |
_seconds
the elapsed seconds from time 0 |
static int |
MILLISECONDS_PER_SECOND
the number of milliseconds in a second |
static int |
SECONDS_PER_HOUR
the number of seconds in an hour |
static int |
SECONDS_PER_MINUTE
the number of seconds in a minute |
| Constructor Summary | |
|---|---|
Time()
Creates a time object with the current real time. |
|
Time(double seconds)
Creates a time object. |
|
Time(int hour,
int minute,
double second)
Creates a time object. |
|
| Method Summary | |
|---|---|
Time |
add_(Time time)
Adds another unit to this one. |
int |
compareTo(Time time)
|
double |
getHourComponent()
Gets the hour component. |
double |
getMinuteComponent()
Gets the minute component. |
double |
getSecondComponent()
Gets the second component. |
double |
getSecondHundredths()
Gets the hundredths component. |
double |
getSeconds()
Gets the elapsed seconds that defines the time. |
double |
getSecondTenths()
Gets the tenths component. |
double |
getValue_()
Returns the numerical value of this unit. |
private void |
setTime(double seconds)
Sets the time. |
private void |
setTime(int hour,
int minute,
double second)
Sets the time. |
Time |
subtract_(Time time)
Subtract another unit from this one. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private double _seconds
public static final int MILLISECONDS_PER_SECOND
public static final int SECONDS_PER_HOUR
public static final int SECONDS_PER_MINUTE
| Constructor Detail |
|---|
public Time()
public Time(double seconds)
seconds - - the elapsed seconds from time 0
public Time(int hour,
int minute,
double second)
hour - - the hour on the interval [0,23]minute - - the minute on the interval [0,59]second - - the second on the interval [0,59]. This may be fractional| Method Detail |
|---|
public Time add_(Time time)
add_ in interface I_Unitable<Time>time - - the unit
public int compareTo(Time time)
compareTo in interface java.lang.Comparable<Time>public double getHourComponent()
public double getMinuteComponent()
public double getSecondComponent()
public double getSecondHundredths()
public double getSeconds()
public double getSecondTenths()
public double getValue_()
getValue_ in interface I_Unitable<Time>private void setTime(double seconds)
seconds - - the elapsed seconds from time 0
private void setTime(int hour,
int minute,
double second)
hour - - the hour on the interval [0,23]minute - - the minute on the interval [0,59]second - - the second on the interval [0,59]. This may be fractionalpublic Time subtract_(Time time)
subtract_ in interface I_Unitable<Time>time - - the unit
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||