|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.Timestamp
public class Timestamp
A immutable timestamp and related utilities. Hopefully lighter weight than java.util.Date (which is mutable), and we don't have to trip over javasoft/Taligent deprecations.
We are using the java "long millisecs since the epoch" as internal representation. This doesn't roll over until August of 292,278,994.
| Field Summary | |
|---|---|
protected long |
millis_
_more_ |
static Timestamp |
NONE
_more_ |
| Constructor Summary | |
|---|---|
Timestamp()
Construct a Timestamp and initialized to the current time. |
|
Timestamp(Date date)
Construct a Timestamp and initialized by a Date object. |
|
Timestamp(int secsPrior)
Construct a Timestamp initialized by current time minus given seconds. |
|
Timestamp(long millis)
Construct a Timestamp and initialized to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object oo)
_more_ |
int |
compareTo(Timestamp ts)
_more_ |
boolean |
equals(Object oo)
_more_ |
StringBuffer |
format(StringBuffer buf)
_more_ |
long |
getMillis()
|
int |
hashCode()
_more_ |
static void |
main(String[] args)
_more_ |
String |
toString()
_more_ |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Timestamp NONE
protected final long millis_
| Constructor Detail |
|---|
public Timestamp(long millis)
millis - long milliseconds since January 1, 1970, 00:00:00 GMTSystem.currentTimeMillis()public Timestamp()
System.currentTimeMillis()public Timestamp(Date date)
date - Datepublic Timestamp(int secsPrior)
secsPrior - number oif seconds prior to current time| Method Detail |
|---|
public long getMillis()
public StringBuffer format(StringBuffer buf)
buf -
public int hashCode()
hashCode in class Objectpublic boolean equals(Object oo)
equals in class Objectoo -
public String toString()
toString in class Objectpublic int compareTo(Timestamp ts)
ts -
public int compareTo(Object oo)
compareTo in interface Comparableoo -
public static void main(String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||