Class TimeObj

java.lang.Object
  |
  +--TimeObj

public class TimeObj
extends java.lang.Object

TimeObj is used to store time information for different input formats


Field Summary
 int pDay
           
 int pHour
           
 int pMinute
           
 int pMonth
           
 float pSeconds
           
 int pYear
           
 
Constructor Summary
TimeObj()
          Create TimeObj for current time
TimeObj(double t)
          Create TimeObj object from Nanometrics time t
TimeObj(int s70)
          Create TimeObj object base on seconds since 1970/1/1 00:00:00
TimeObj(int min, float s)
          Create TimeObj object from SED time minute second
TimeObj(int yr, int mon, int day, int hr, int min, float sec)
          Create TimeObj object base specific date as year,month,day,hour,minute,seconds
TimeObj(long s70)
          Create TimeObj object base on long seconds since 1970/1/1 00:00:00
TimeObj(java.lang.String ns)
          Create TimeObj object base on Nanometrics String convention: e.g.
TimeObj(java.lang.String t, java.lang.String fmt)
          Create TimeObj object base on any string 't' formatted according to string 'fmt' e.g.
TimeObj(TimeObj o)
          Create TimeObj object from Nanometrics time t
 
Method Summary
 void addTo(float t)
          add time of 't' to this object
 void addTo(TimeObj t)
           
 int getDay()
          returns the day component
 int getHour()
          returns the hour component
 int getJuliam()
          returns the minutes component
 int getMinute()
          returns the minute component
 int getMonth()
          returns the month component
 double getNxtime()
          returns the nmx-seconds component
 float getSeconds()
          returns the seconds component
 int getYear()
          returns the year component
static void main(java.lang.String[] args)
           
 long minus(TimeObj t)
          returns difference of this ojbect minus the argument object (returns milliseconds)
 boolean olderThan(TimeObj t)
          if this object is older than argument object then return true
 java.lang.String toInternationalString()
           
 java.lang.String toString()
          returns a string representation of the time
 boolean youngerThan(TimeObj t)
          if this object is younger than argument object then return true
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pYear

public int pYear

pMonth

public int pMonth

pDay

public int pDay

pHour

public int pHour

pMinute

public int pMinute

pSeconds

public float pSeconds
Constructor Detail

TimeObj

public TimeObj()
Create TimeObj for current time

TimeObj

public TimeObj(TimeObj o)
Create TimeObj object from Nanometrics time t

TimeObj

public TimeObj(double t)
Create TimeObj object from Nanometrics time t

TimeObj

public TimeObj(int min,
               float s)
Create TimeObj object from SED time minute second

TimeObj

public TimeObj(java.lang.String ns)
Create TimeObj object base on Nanometrics String convention: e.g. 1998-12-01-17-49-55
See Also:
TimeObj(String)

TimeObj

public TimeObj(int s70)
Create TimeObj object base on seconds since 1970/1/1 00:00:00
See Also:
TimeObj(int)

TimeObj

public TimeObj(long s70)
Create TimeObj object base on long seconds since 1970/1/1 00:00:00
See Also:
TimeObj(int)

TimeObj

public TimeObj(int yr,
               int mon,
               int day,
               int hr,
               int min,
               float sec)
Create TimeObj object base specific date as year,month,day,hour,minute,seconds
See Also:
TimeObj(int,int,int,int,int,float)

TimeObj

public TimeObj(java.lang.String t,
               java.lang.String fmt)
Create TimeObj object base on any string 't' formatted according to string 'fmt' e.g. fmt='YYYY-MM-DD-HH-NN-SS.SSS', or 'MM/YYYY/DD HH:MM:SS'
See Also:
TimeObj(String,String)
Method Detail

getYear

public int getYear()
returns the year component

getMonth

public int getMonth()
returns the month component

getDay

public int getDay()
returns the day component

getHour

public int getHour()
returns the hour component

getMinute

public int getMinute()
returns the minute component

getSeconds

public float getSeconds()
returns the seconds component

getNxtime

public double getNxtime()
returns the nmx-seconds component

getJuliam

public int getJuliam()
returns the minutes component

addTo

public void addTo(float t)
add time of 't' to this object

addTo

public void addTo(TimeObj t)

minus

public long minus(TimeObj t)
returns difference of this ojbect minus the argument object (returns milliseconds)

olderThan

public boolean olderThan(TimeObj t)
if this object is older than argument object then return true

youngerThan

public boolean youngerThan(TimeObj t)
if this object is younger than argument object then return true

toString

public java.lang.String toString()
returns a string representation of the time
Overrides:
toString in class java.lang.Object

toInternationalString

public java.lang.String toInternationalString()

main

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