|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Date | +--gov.noaa.pmel.util.GeoDate
GeoDate
extends the capabilities of Date
.
Additional features of GeoDate
include methods for
incrementing and decrementing, adding and substracting
GeoDate
objects. All GeoDate
objects
share the same GregorianCalendar
set to a "GMT" time
zone. Thus, all GeoDate
times are in "GMT". This
simplifies the conversion to and from String
representations of time.
GregorianCalendar
, Serialized FormField Summary | |
static int |
DAYS
Increment or decrement in days. |
static int |
HOURS
Increment or decrement in hours. |
static int |
MINUTES
Increment or decrement in minutes |
static int |
MONTHS
Increment or decrement in months. |
static int |
MSEC
Increment or decrement in milliseconds |
static long |
MSECS_IN_DAY
Number of milliseconds in a day. |
static int |
SECONDS
Increment or decrement in seonds |
static int |
YEARS
Increment or decrement in years. |
Constructor Summary | |
GeoDate()
Construct a new GeoDate . |
|
GeoDate(java.util.Date date)
Construct a new GeoDate from a
Date object. |
|
GeoDate(GeoDate t)
Constructs a new GeoDate from an
existing GeoDate . |
|
GeoDate(int jday,
int msec)
Construct a new GeoDate from EPIC double integers. |
|
GeoDate(int mon,
int day,
int year,
int hour,
int min,
int sec,
int msec)
Construct a new GeoDate from values. |
|
GeoDate(long date)
Allocates a GeoDate object and initializes it to represent the specified number of milliseconds since the standard base time know as "the epoch", namely January 1, 1970, 00:00:00 GMT. |
|
GeoDate(java.lang.String time,
java.lang.String format)
Construct a new GeoDate from a
String . |
Method Summary | |
GeoDate |
add(GeoDate time)
Add time to current GeoDate . |
int |
compareTo(GeoDate anotherDate)
Tests to see if the current GeoDate is less than, equal, or greater than. |
GeoDate |
decrement(double val,
int tu)
Decrement current GeoDate
by SECONDS , MINUTES , HOURS ,
DAYS , MONTHS , or YEARS |
GeoDate |
decrement(float val,
int tu)
Decrement current GeoDate
by SECONDS , MINUTES , HOURS ,
DAYS , MONTHS , or YEARS |
GeoDate |
divide(double val)
Divide by value. |
java.util.Calendar |
getCalendar()
Get a reference to the GregorianCalendar set
to the current GeoDate time. |
int |
getDay()
Deprecated. Overrides a deprecated method, replaced by getGMTDay() . |
int |
getDaysInMonth()
Get the number of days in the current month. |
int |
getGMTDay()
Get day |
int |
getGMTHours()
Get hours |
int |
getGMTMinutes()
Get minutes |
int |
getGMTMonth()
Get month |
double |
getGMTSeconds()
Get seconds and fraction of seconds. |
int |
getGMTYear()
Get year. |
int |
getHours()
Deprecated. Overrides a deprecated method, replaced by getGMTHours() . |
int |
getJDay()
get EPIC Julian Day |
int |
getMinutes()
Deprecated. Overrides a deprecated method, replaced by getGMTMinutes() . |
int |
getMonth()
Deprecated. Overrides a deprecated method, replaced by getGMTMonth() . |
int |
getMSec()
get milliseconds since midnight |
double |
getSecondss()
Deprecated. replaced by getGMTSeconds() . |
int |
getYear()
Deprecated. Overrides a deprecated method, replaced by getGMTYear() . |
int |
getYearday()
Get year-day number (Jan 1 = 1) |
GeoDate |
increment(double val,
int tu)
Increment current GeoDate
by SECONDS , MINUTES , HOURS ,
DAYS , MONTHS , or YEARS |
GeoDate |
increment(float val,
int tu)
Increment current GeoDate
by SECONDS , MINUTES , HOURS ,
DAYS , MONTHS , or YEARS |
boolean |
isMissing()
Tests to see if value represents missing data. |
boolean |
isRelativeTime()
Tests the relativeTime flag. |
void |
now()
Set to current time. |
double |
offset(GeoDate ref)
Time offset from reference GeoDate |
void |
set(int jday,
int msec)
Change value of GeoDate from EPIC double
integers. |
void |
set(int mon,
int day,
int year,
int hour,
int min,
int sec,
int msec)
Change value of GeoDate from values. |
void |
setRelativeTime(boolean relative)
Set the relativeTime flag. |
void |
setYearYearDay(int year,
int yearday)
Set a GeoDate from year and year-day. |
GeoDate |
subtract(GeoDate time2)
Subtract time2 from current GeoDate . |
java.lang.String |
toString()
Convert GeoDate to String
using standard format "yyyy-MM-dd HH:mm:ss z"
and "GMT" time zone. |
java.lang.String |
toString(java.lang.String format)
Convert GeoDate to String
using provided format. |
Methods inherited from class java.util.Date |
after, before, clone, compareTo, compareTo, equals, getDate, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DAYS
public static final int MONTHS
public static final int YEARS
public static final int HOURS
public static final int MINUTES
public static final int SECONDS
public static final int MSEC
public static final long MSECS_IN_DAY
Constructor Detail |
public GeoDate()
GeoDate
.public GeoDate(java.lang.String time, java.lang.String format) throws IllegalTimeValue
GeoDate
from a
String
. Formatting is done using
SimpleDateFormat
. The specified time
is taken to be "GMT".time
- character representation of timeformat
- codes used to read timepublic GeoDate(GeoDate t)
GeoDate
from an
existing GeoDate
.t
- GeoDate
public GeoDate(int mon, int day, int year, int hour, int min, int sec, int msec) throws IllegalTimeValue
GeoDate
from values. The
specified time is taken to be "GMT".mon
- monthday
- day of the monthyear
- year (no offset!)hour
- hourmin
- minutessec
- secondsmsec
- millisecondsIllegalTimeValue
- The constructor was called with a set
of parameters that does not constitute a legitimate time value.public GeoDate(java.util.Date date)
GeoDate
from a
Date
object. No time zone conversion
is done.date
- Date objectpublic GeoDate(int jday, int msec)
GeoDate
from EPIC double integers.
Time zone for conversion is "GMT".jday
- julian daymsec
- milliseconds since midnightpublic GeoDate(long date)
Method Detail |
public void setRelativeTime(boolean relative)
GeoDate
object does not represent an actual
absolute time, but a temporal duration.public boolean isRelativeTime()
public void set(int jday, int msec)
GeoDate
from EPIC double
integers.
Time zone for conversion is "GMT".jday
- julian daymsec
- milliseconds since midnightpublic void set(int mon, int day, int year, int hour, int min, int sec, int msec) throws IllegalTimeValue
GeoDate
from values.
Time zone for conversion is "GMT".mon
- month (1=January, 12=December)day
- day of the monthyear
- year (no offset!)hour
- hourmin
- minutessec
- secondsmsec
- millisecondsIllegalTimeValue
- The parameters passed to this method represent a time
value that is invalidpublic int getDaysInMonth()
public void now()
public GeoDate add(GeoDate time)
GeoDate
. This operation only
makes since if time
is a relative time value,
i.e. the result of a
GeoDate
subrtraction.time
- GeoDate
GeoDate
public GeoDate subtract(GeoDate time2)
GeoDate
.time2
- subtracthendGeoDate
public GeoDate divide(double val)
val
- divisorGeoDate
public GeoDate increment(float val, int tu)
GeoDate
by SECONDS
, MINUTES
, HOURS
,
DAYS
, MONTHS
, or YEARS
val
- amount to incrementtu
- time units (SECONDS
, MINUTES
, HOURS
, DAYS
, MONTHS
, or YEARS
)
operation.public GeoDate increment(double val, int tu)
GeoDate
by SECONDS
, MINUTES
, HOURS
,
DAYS
, MONTHS
, or YEARS
val
- amount to incrementtu
- time units (SECONDS
, MINUTES
, HOURS
, DAYS
, MONTHS
, or YEARS
)
operation.public GeoDate decrement(float val, int tu)
GeoDate
by SECONDS
, MINUTES
, HOURS
,
DAYS
, MONTHS
, or YEARS
val
- amount to decrementtu
- time units (SECONDS
, MINUTES
, HOURS
, DAYS
, MONTHS
, or YEARS
)
operation.public GeoDate decrement(double val, int tu)
GeoDate
by SECONDS
, MINUTES
, HOURS
,
DAYS
, MONTHS
, or YEARS
val
- amount to decrementtu
- time units (SECONDS
, MINUTES
, HOURS
, DAYS
, MONTHS
, or YEARS
)
operation.public double offset(GeoDate ref)
GeoDate
ref
- reference GeoDate
public void setYearYearDay(int year, int yearday)
GeoDate
from year and year-day.year
- yearyearday
- year-day number (Jan 1 = 1)
parameters that does not constitute a legitimate time value.public java.util.Calendar getCalendar()
GregorianCalendar
set
to the current GeoDate
time.Calendar
public int getYearday()
public int getYear()
getGMTYear()
.
getYear
in class java.util.Date
java.util.Date
Calendar
public int getGMTYear()
public int getMonth()
getGMTMonth()
.
getMonth
in class java.util.Date
java.util.Date
Calendar
public int getGMTMonth()
public int getDay()
getGMTDay()
.
getDay
in class java.util.Date
java.util.Date
Calendar
public int getGMTDay()
public int getHours()
getGMTHours()
.
getHours
in class java.util.Date
java.util.Date
Calendar
public int getGMTHours()
public int getMinutes()
getGMTMinutes()
.
getMinutes
in class java.util.Date
java.util.Date
Calendar
public int getGMTMinutes()
public double getSecondss()
getGMTSeconds()
.
public double getGMTSeconds()
public int getJDay()
public int getMSec()
public java.lang.String toString()
GeoDate
to String
using standard format "yyyy-MM-dd HH:mm:ss z"
and "GMT" time zone.toString
in class java.util.Date
public java.lang.String toString(java.lang.String format)
GeoDate
to String
using provided format. The SimpleDateFormat
and the GregorianCalendar
is used to format
the GeoDate
. A format of "decade" will create
a string of the form 1990 or 1980.format
- String containing codes used to write time.SimpleDateFormat
public boolean isMissing()
Long.MIN_VALUE
represents a
missing observation.SGTData.getXRange()
public int compareTo(GeoDate anotherDate)
|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |