public class IstiEpoch
extends java.lang.Object
implements java.lang.Comparable, java.util.Comparator
Modifier and Type | Field and Description |
---|---|
static int |
AllTime |
static int |
Day |
static int |
DayHr |
static int |
DayHrMin |
static int |
DayHrMinSec |
static int |
DayHrMinSecMsec |
static java.lang.String |
defaultBottomFormat |
static java.lang.String |
defaultFormat |
static int |
Epoch |
static java.lang.String |
epochFormat |
static int |
HrMin |
static int |
HrMinSec |
static int |
HrMinSecMSec |
static int |
Min |
static int |
MinSec |
static int |
MinSecMsec |
(package private) static java.lang.String[] |
monthNames |
static int |
Msec |
static int |
None |
static int |
SecMsec |
static int |
YearDay |
static int |
YearDayHr |
static int |
YearDayHrMin |
static int |
YearDayHrMinSec |
Constructor and Description |
---|
IstiEpoch()
This constructor sets the time to 0 milliseconds.
|
IstiEpoch(java.util.Calendar calendar)
Creates an IstiEpoch from an existing calendar.
|
IstiEpoch(java.util.Date date)
Creates an IstiEpoch from a Date
|
IstiEpoch(double seconds)
Creates an IstiEpoch from the number of seconds from the Epoch time
|
IstiEpoch(IstiEpoch epoch)
Creates an IstiEpoch from another Epoch time
|
IstiEpoch(long milliseconds)
Creates an IstiEpoch from the number of milliseconds from the Epoch time
|
IstiEpoch(long seconds,
long milliseconds)
Creates an IstiEpoch from the number of seconds and milliseconds from the
Epoch time
|
IstiEpoch(java.lang.String respTime)
Creates an IstiEpoch from a string in RESP output format YYYY,DDD,HH:MM:SS
from the Epoch time
|
Modifier and Type | Method and Description |
---|---|
double |
absDiff(IstiEpoch epoch)
This function returns the number of seconds between this and another
IstiEpoch
|
void |
add(double seconds)
This function adds the number of seconds to the time
|
java.lang.String |
btimeFormattedString()
Get the Btime formatted string
|
java.lang.String |
CanadaFormattedString()
format like this.....
|
void |
clear()
Clear the time by setting the Epoch to 0.
|
int |
compare(IstiEpoch time1,
IstiEpoch time2)
Compares its two arguments for order.
|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares its two arguments for order.
|
int |
compareTo(IstiEpoch anotherTime)
Compares this IstiEpoch to another Object.
|
int |
compareTo(java.lang.Object o)
Compares this IstiEpoch to another Object.
|
double |
diff(IstiEpoch epoch)
This function returns the number of seconds between this and another
IstiEpoch
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
fileFormattedString() |
java.lang.String |
FissuresFormattedString()
format like this.....
|
java.lang.String |
formatInt(java.lang.String item,
int places)
Get a string with at least the specified number of places by padded with
zero's.
|
java.lang.String |
formattedString() |
java.lang.String |
formattedString(int type) |
java.lang.String |
formattedString(java.lang.String name) |
int |
get(int calVal)
Get the value for the given calendar field.
|
double |
getEpoch()
Get the number of seconds from the epoch time
|
static java.lang.String[] |
getFormattedStrings() |
static java.lang.String |
getFormatType(int type) |
java.util.GregorianCalendar |
getGregorianCalendar()
Get the GregorianCalendar
|
java.lang.String |
getHr()
Get the hour of day
|
int |
getIntDOM()
Get the day of month
|
int |
getIntDOY()
Get the day of year
|
int |
getIntEpoch()
Deprecated.
This only supports up to the year 2038, use
getIntEpochSeconds() . |
long |
getIntEpochMSecs()
Get the number of milliseconds from the epoch time
|
long |
getIntEpochSeconds()
Get the number of seconds from the epoch time
|
int |
getIntHr()
Get the hour of day.
|
int |
getIntInt(int calVal)
Get the value for the given calendar field.
|
int |
getIntMn()
Get the minute within the hour.
|
int |
getIntMonth()
Get the month.
|
int |
getIntSec()
Get the second within the minute.
|
int |
getIntYear()
Get the year
|
java.lang.String |
getJDay()
Get the text for the day of the year.
|
long |
getLongEpoch()
Get the number of seconds from the epoch time
|
int |
getmDay()
Get the day of month
|
java.lang.String |
getMDay()
Get the month
|
java.lang.String |
getMessage()
Get the message that some methods leave
|
java.lang.String |
getMn()
Get the text for the minute within the hour
|
java.lang.String |
getMonStr()
Get the text for the month
|
java.lang.String |
getMSecond()
Get the text for milliseconds with 3 places
|
java.lang.String |
getMsecond(int places)
Get the text for milliseconds
|
java.lang.String |
getSecond()
Get the text for second within the minute
|
java.lang.String |
getTenthsMillisecond()
Get the text for tenths milliseconds
|
java.util.Date |
getTime()
Get the time
|
long |
getTimeInMillis()
Gets the current time as a long.
|
java.util.TimeZone |
getTimeZone()
Get the time zone
|
java.lang.String |
getYear()
Get the text for the year
|
int |
hashCode()
Returns a hash code value for this object.
|
java.lang.String |
hrminsecmsString() |
java.lang.String |
hrminsecString() |
boolean |
inTimeRange(IstiEpoch start,
IstiEpoch end)
Determines if this IstiEpoch is in the specified time range.
|
boolean |
isAfter(double rtime)
Determines if this IstiEpoch if after given time
|
boolean |
isAfter(IstiEpoch refTime)
Determines if this IstiEpoch if after given time
|
boolean |
isAfterEqual(IstiEpoch refTime)
Determines if this IstiEpoch if after or equal to the given time
|
boolean |
isAfterNotEqual(IstiEpoch refTime)
Determines if this IstiEpoch is after and not equal to the given time
|
boolean |
isBefore(double rtime)
Determines if this IstiEpoch is before the given time
|
boolean |
isBefore(IstiEpoch refTime)
Determines if this IstiEpoch is before the given time
|
boolean |
isBeforeEqual(IstiEpoch refTime)
Determines if this IstiEpoch is before or equal to the given time
|
boolean |
isBeforeNotEqual(IstiEpoch refTime)
Determines if this IstiEpoch is before and not equal to the given time
|
boolean |
isEqualTo(IstiEpoch refTime)
Determines if this IstiEpoch is equal to the given time
|
boolean |
isEvenMinute()
Determines if this IstiEpoch is at an even minute
|
java.lang.String |
ISO8601FormattedString() |
java.lang.String |
labelformattedString() |
java.lang.String |
longformattedString() |
static void |
main(java.lang.String[] args) |
java.lang.String |
minsecString() |
void |
minus(double seconds)
This function subtracts the number of seconds from the time
|
java.lang.String |
secString() |
void |
set(int year,
int month,
int day,
int hr,
int min)
Set everything but the seconds.
|
void |
setDateToTODAY()
trims the time to the start of the current day (leave time alone)
|
void |
setHr(int hour)
Set the hour of day
|
void |
setIntTime(double seconds)
set time passing in seconds since 1970
|
void |
setIntTime(int seconds)
set time passing in seconds since 1970
|
void |
setIntTime(long seconds)
set time passing in seconds since 1970
|
void |
setJDay(int doy)
Set the day of year
|
void |
setmDay(int day)
Set the day of month
|
void |
setMn(int min)
Set the minute within the hour
|
void |
setMonth(int month)
Set the month
|
void |
setMSecond(int millisecond)
Set the millisecond within the second
|
void |
setSec(int second)
Set the second within the minute
|
void |
setSecond(int second)
Set the second within the minute
|
void |
setTime(java.util.Calendar calendar)
Set time passing in an existing calendar.
|
void |
setTime(java.util.Date date)
Sets the time.
|
void |
setTime(double dsecs)
set time passing in seconds since 1970
|
void |
setTime(int year,
int jday,
int hr,
int min,
int sec)
Set the time
|
void |
setTime(IstiEpoch epoch)
Set time passing in another Epoch time.
|
void |
setTime(long msecs)
set time passing in milliseconds since 1970.
|
void |
setTime(long seconds,
long milliseconds)
set time passing in seconds and milliseconds since 1970
|
void |
setTime(java.lang.String respTime)
set time from RESP format string time.
|
void |
setTimeAltFissuresTime(java.lang.String ftime)
accepts the time in the format YYYY-MM-DDTHH:MM:SS.mmmZ
|
void |
setTimeCanadaTime(java.lang.String ftime)
accepts the time in the format YYYYMMDD.HHMM
|
void |
setTimeFissuresTime(java.lang.String ftime)
accepts the time in the format YYYY-MM-DDTHH:MM:SS.mmmZ
|
void |
setTimeInMillis(long millis)
Sets the current time from the given long value.
|
void |
setTimetoDay()
trims the time to the start of the current day
|
void |
setTimetoDay(IstiEpoch epoch)
trims the time to the start of the desired day
|
IstiEpoch |
settoCurrentTime()
Set to the current time.
|
void |
setYear(int year)
Set the year
|
java.lang.String |
toString()
Get a string representation of the epoch
|
static java.lang.String |
toString(double seconds)
Get a string representation for the time
|
java.lang.String |
toWaveviewerRequestString() |
java.lang.String |
yeardayString() |
java.lang.String |
yearmondayhrminString() |
java.lang.String |
yearmondayString() |
public static final java.lang.String epochFormat
public static final java.lang.String defaultFormat
public static final java.lang.String defaultBottomFormat
public static final int None
public static final int AllTime
public static final int YearDayHrMinSec
public static final int YearDayHrMin
public static final int YearDayHr
public static final int YearDay
public static final int DayHrMinSecMsec
public static final int DayHrMinSec
public static final int DayHrMin
public static final int DayHr
public static final int Day
public static final int HrMinSecMSec
public static final int HrMinSec
public static final int HrMin
public static final int MinSecMsec
public static final int MinSec
public static final int Min
public static final int SecMsec
public static final int Msec
public static final int Epoch
static final java.lang.String[] monthNames
public IstiEpoch()
settoCurrentTime()
public IstiEpoch(java.util.Calendar calendar)
calendar
- the calendarpublic IstiEpoch(java.util.Date date)
date
- the datepublic IstiEpoch(double seconds)
seconds
- the seconds from the Epoch timepublic IstiEpoch(IstiEpoch epoch)
epoch
- the other Epoch time or null if nonepublic IstiEpoch(long milliseconds)
milliseconds
- milliseconds since 1970.public IstiEpoch(long seconds, long milliseconds)
seconds
- seconds since 1970.milliseconds
- milliseconds since 1970.public IstiEpoch(java.lang.String respTime)
respTime
- the RESP timepublic double absDiff(IstiEpoch epoch)
epoch
- the other epoch timepublic void add(double seconds)
seconds
- the number of secondspublic java.lang.String btimeFormattedString()
public java.lang.String CanadaFormattedString()
public void clear()
public int compare(IstiEpoch time1, IstiEpoch time2)
time1
- the first time.time2
- the second time.public int compare(java.lang.Object o1, java.lang.Object o2) throws java.lang.ClassCastException
compare
in interface java.util.Comparator
o1
- the first Object.o2
- the second Object.java.lang.ClassCastException
- - if an argument is not an IstiEpoch.public int compareTo(IstiEpoch anotherTime)
anotherTime
- the time to be compared.public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- Objectjava.lang.ClassCastException
- - if the argument is not an IstiEpoch.public double diff(IstiEpoch epoch)
epoch
- another epoch timepublic boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
public java.lang.String fileFormattedString()
public java.lang.String FissuresFormattedString()
public java.lang.String formatInt(java.lang.String item, int places)
item
- the textplace
- the number of placespublic java.lang.String formattedString()
public java.lang.String formattedString(int type)
public java.lang.String formattedString(java.lang.String name)
public int get(int calVal)
calVal
- the calendar field.public double getEpoch()
public java.util.GregorianCalendar getGregorianCalendar()
public java.lang.String getHr()
public int getIntDOM()
public int getIntDOY()
public int getIntEpoch()
getIntEpochSeconds()
.public long getIntEpochMSecs()
public long getIntEpochSeconds()
public int getIntHr()
public int getIntInt(int calVal)
calVal
- the calendar field.public int getIntMn()
public int getIntMonth()
public int getIntSec()
public int getIntYear()
public java.lang.String getJDay()
public long getLongEpoch()
public int getmDay()
public java.lang.String getMDay()
public java.lang.String getMessage()
public java.lang.String getMn()
public java.lang.String getMonStr()
public java.lang.String getMsecond(int places)
place
- the number of placespublic java.lang.String getMSecond()
public java.lang.String getSecond()
public java.lang.String getTenthsMillisecond()
public java.util.Date getTime()
public long getTimeInMillis()
public java.util.TimeZone getTimeZone()
public java.lang.String getYear()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String hrminsecmsString()
public java.lang.String hrminsecString()
public boolean inTimeRange(IstiEpoch start, IstiEpoch end)
public boolean isAfter(double rtime)
public boolean isAfter(IstiEpoch refTime)
public boolean isAfterEqual(IstiEpoch refTime)
public boolean isAfterNotEqual(IstiEpoch refTime)
public boolean isBefore(double rtime)
public boolean isBefore(IstiEpoch refTime)
public boolean isBeforeEqual(IstiEpoch refTime)
public boolean isBeforeNotEqual(IstiEpoch refTime)
public boolean isEqualTo(IstiEpoch refTime)
public boolean isEvenMinute()
public java.lang.String ISO8601FormattedString()
public java.lang.String labelformattedString()
public java.lang.String longformattedString()
public java.lang.String minsecString()
public void minus(double seconds)
seconds
- the number of secondspublic java.lang.String secString()
public void set(int year, int month, int day, int hr, int min)
year
- the yearmonth
- the monthday
- the day of yearhr
- the hour of daymin
- the minute within the hourpublic void setDateToTODAY()
public void setHr(int hour)
hour
- the hour of daypublic void setIntTime(double seconds)
seconds
- seconds since 1970public void setIntTime(int seconds)
seconds
- seconds since 1970public void setIntTime(long seconds)
seconds
- seconds since 1970public void setJDay(int doy)
doy
- the day of yearpublic void setmDay(int day)
day
- the day of monthpublic void setMn(int min)
min
- the minute within the hourpublic void setMonth(int month)
month
- the monthpublic void setMSecond(int millisecond)
millisecond
- the millisecond within the secondpublic void setSec(int second)
second
- the second within the minutepublic void setSecond(int second)
second
- the second within the minutepublic final void setTime(java.util.Calendar calendar)
calendar
- the calendar.public final void setTime(java.util.Date date)
date
- the date.public final void setTime(double dsecs)
dsecs
- the seconds since 1970public void setTime(int year, int jday, int hr, int min, int sec)
year
- the yearjday
- the day of yearhr
- the hour of daymin
- the minute within the hoursec
- the second within the minutepublic final void setTime(IstiEpoch epoch)
epoch
- the epoch time.public final void setTime(long msecs)
msecs
- milliseconds since 1970.public final void setTime(long seconds, long milliseconds)
seconds
- seconds since 1970.milliseconds
- milliseconds since 1970.public final void setTime(java.lang.String respTime)
respTime
- the RESP format string timepublic void setTimeAltFissuresTime(java.lang.String ftime)
ftime
- Stringpublic void setTimeCanadaTime(java.lang.String ftime)
ftime
- Stringpublic void setTimeFissuresTime(java.lang.String ftime)
ftime
- Stringpublic final void setTimeInMillis(long millis)
millis
- the new time in UTC milliseconds from the epoch, January 1,
1970, 00:00:00.public void setTimetoDay()
public void setTimetoDay(IstiEpoch epoch)
epoch
- the epoch timepublic IstiEpoch settoCurrentTime()
public void setYear(int year)
year
- the yearpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toWaveviewerRequestString()
public java.lang.String yeardayString()
public java.lang.String yearmondayhrminString()
public java.lang.String yearmondayString()
public static java.lang.String[] getFormattedStrings()
public static java.lang.String getFormatType(int type)
public static void main(java.lang.String[] args)
public static java.lang.String toString(double seconds)
seconds
- the seconds from the Epoch time