faa.tg.scenario
Class SystemTime

java.lang.Object
  extended by faa.tg.units.AMeasure
      extended by faa.tg.units.Time
          extended by faa.tg.scenario.SystemTime
All Implemented Interfaces:
HasText, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AMeasure>

public class SystemTime
extends Time

 The SystemTime is the system wallclock time.
 See Nas Time for times that will be used external to the system.
 See Simulation Time for times that will be used internal to the system.
 
See the source: SystemTime.java

Version:
$Id: SystemTime.java,v 3.2 2008/11/24 22:12:27 lykensj Exp $
Author:
Dan Warburton, FAA/ACT-510
See Also:
Time, NasTime, SimulationTime, Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private static java.text.DecimalFormat dec00
           
private  Time now
           
(package private) static long serialVersionUID
           
 
Fields inherited from class faa.tg.units.Time
MAX, MIN_1, MIN_10, MIN_5, MS_1, ONE_MILLISEC, ONE_MIN, ONE_SEC, SEC_1, SEC_10, SEC_20, SEC_5, SORT_DATE_FMT, STD_DATE_FMT, TEN_MIN, ZERO
 
Fields inherited from class faa.tg.units.AMeasure
DEC0, DEC0_, DEC00, DEC000, DEC1, DEC1_, DEC12, DEC12_, DEC1L, DEC1L_, DEC2, DEC2_, DEC3, DEC3_, DEC4, DEC4_, DEC5, DEC5_, DEC6, DEC6_, DEC7, DEC7_, DEC9, DEC9_, itsValue, TIME_FRACTION
 
Constructor Summary
SystemTime()
          Constructor for the current system wallclock time in milliseconds.
SystemTime(java.util.Calendar calendarTime)
          Constructor to set the given system wallclock time from a Calendar.
SystemTime(Time time)
          Constructor to set the given system wallclock time from a Time measure.
 
Method Summary
 SystemTime clone()
          Get a clone of the current SystemTime, since the time can be reset.
 Time getNow()
          Returns the current SystemTime as an immutable Time measure.
static void main(java.lang.String[] args)
           
private  void readObject(java.io.ObjectInputStream in)
          If this object is imported from a Serializable SystemTime created before 2002/04/11, the "now" value is set so that it is not null.
 void setNow()
          Set the SystemTime to the current time.
 java.lang.String toFilenameString()
          Returns a easily readable string representation of the System time that contains only characters suitable for a filename.
 java.lang.String toHmsNumberString()
          Returns the time of day for this SystemTime in "HHMMSS" String format.
 java.lang.String toHmsString()
          Returns the time of day for this SystemTime in "HH:MM:SS" String format.
 java.lang.String toString()
          Returns a string representation of this object.
 java.lang.String toYmdHmsNumberString()
          Returns a string representation of the time with only numerics: format is "YYYYMMDDHHMMSS".
 java.lang.String toYmdHmsString()
          Returns this object in "YYYY-MM-DD HH:MM:SS" String format.
 java.lang.String toYmdNumberString()
          Returns a string representation of the time with only numerics: format is "YYYYMMDD".
 java.lang.String toYmdString()
          Returns a string representation of this object in "YYYY-MM-DD" format.
 java.lang.String toYmdTTimeString()
          Returns the time as a String formatted as "YYYY-MM-DD-THHMM", for example: "2003-01-28-T1449" (the current jar file name format).
 
Methods inherited from class faa.tg.units.Time
abs, add, as, eq, ge, gt, hms2sec, le, lt, now, parseSeconds, parseTime, ratio, sub, timeElapsedSince, toHhmmString, toHmsStringInt, toText
 
Methods inherited from class faa.tg.units.AMeasure
absoluteValue, add, as, as, compareTo, debug, div, eq, equals, ge, getAUnit, getCanonicalUnit, getCanonicalValue, getInitialUnit, getUnitClass, gt, hashCode, isBetween, le, lt, mul, ratio, sub, toAMeasure, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

dec00

private static final java.text.DecimalFormat dec00

now

private Time now
Constructor Detail

SystemTime

public SystemTime()
Constructor for the current system wallclock time in milliseconds.


SystemTime

public SystemTime(java.util.Calendar calendarTime)
Constructor to set the given system wallclock time from a Calendar.


SystemTime

public SystemTime(Time time)
Constructor to set the given system wallclock time from a Time measure.

Method Detail

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
If this object is imported from a Serializable SystemTime created before 2002/04/11, the "now" value is set so that it is not null.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

clone

public SystemTime clone()
Get a clone of the current SystemTime, since the time can be reset.

Overrides:
clone in class AMeasure
Returns:
the cloned object

getNow

public Time getNow()
Returns the current SystemTime as an immutable Time measure.


setNow

public void setNow()
Set the SystemTime to the current time.


toHmsString

public java.lang.String toHmsString()
Returns the time of day for this SystemTime in "HH:MM:SS" String format.

Overrides:
toHmsString in class Time
Returns:
The time of day for this SystemTime in the form "HH:MM:SS".

toHmsNumberString

public java.lang.String toHmsNumberString()
Returns the time of day for this SystemTime in "HHMMSS" String format.

Returns:
The time of day for this SystemTime in the form "HHMMSS".

toYmdHmsString

public java.lang.String toYmdHmsString()
Returns this object in "YYYY-MM-DD HH:MM:SS" String format.

Returns:
The SystemTime in the form "YYYY-MM-DD HH:MM:SS".

toYmdHmsNumberString

public java.lang.String toYmdHmsNumberString()
Returns a string representation of the time with only numerics: format is "YYYYMMDDHHMMSS".

Returns:
The SystemTime in the form "YYYYMMDDHHMMSS".

toYmdTTimeString

public java.lang.String toYmdTTimeString()
Returns the time as a String formatted as "YYYY-MM-DD-THHMM", for example: "2003-01-28-T1449" (the current jar file name format).

Returns:
The SystemTime in the form "YYYY-MM-DD-THHMM".

toFilenameString

public java.lang.String toFilenameString()
Returns a easily readable string representation of the System time that contains only characters suitable for a filename.

Returns:
The SystemTime in the form "YYYYMonDD_HHMMSS".

toYmdString

public java.lang.String toYmdString()
Returns a string representation of this object in "YYYY-MM-DD" format.

Returns:
The SystemTime in the form "YYYY-MM-DD".

toYmdNumberString

public java.lang.String toYmdNumberString()
Returns a string representation of the time with only numerics: format is "YYYYMMDD".

Returns:
The SystemTime in the form "YYYYMMDD".

toString

public java.lang.String toString()
Returns a string representation of this object. In general, the toString method returns a String that "textually represents" this object.

Overrides:
toString in class Time
Returns:
String a String representation of this object
See Also:
AMeasure

main

public static void main(java.lang.String[] args)