|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.activequant.domainmodel.TimeStamp
public final class TimeStamp
Immutable UTC date/time in nanosecond resolution.
- [26.11.2007] Created (Mike Kroutkov)
- [10.10.2009] + Time component getter (Ghost Rider)
| Constructor Summary | |
|---|---|
TimeStamp()
Creates new TimeStamp object that corresponds to the current time. |
|
TimeStamp(Date dateValue)
Creates new TimeStamp object from date's millisecond value, nanosecond part is set to zero. |
|
TimeStamp(Date dateValue,
int nanos)
Creates new TimeStamp object from date's millisecond value, and nanosecond value. |
|
TimeStamp(long value)
Creates new Timestamp object from nanosecond value. |
|
| Method Summary | |
|---|---|
TimeStamp |
addDays(long days)
returns a new time stamp to which days are added. |
int |
compareTo(TimeStamp other)
|
boolean |
equals(Object other)
|
Date |
getDate()
|
long |
getMilliseconds()
|
long |
getNanoseconds()
Returns time in nanoseconds since Unix epoch (Jan 1, 1970 UTC). |
Time |
getTimeComponent()
|
int |
hashCode()
|
boolean |
isAfter(TimeStamp other)
|
boolean |
isBefore(TimeStamp other)
|
boolean |
isEqual(TimeStamp other)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TimeStamp(long value)
value - nanoseconds since Jan 1, 1970 UTC.
public TimeStamp(Date dateValue,
int nanos)
dateValue - date.nanos - nanosecond part of the timestamp.public TimeStamp(Date dateValue)
dateValue - date.public TimeStamp()
new TimeStamp(new Date());and therefore provides only millisecond precision (nanosecond part is guaranteed to be zero).
| Method Detail |
|---|
public long getNanoseconds()
public long getMilliseconds()
public Date getDate()
public int hashCode()
hashCode in class Objectpublic int compareTo(TimeStamp other)
compareTo in interface Comparable<TimeStamp>public boolean equals(Object other)
equals in class Objectpublic boolean isBefore(TimeStamp other)
public boolean isAfter(TimeStamp other)
public boolean isEqual(TimeStamp other)
public String toString()
toString in class Objectpublic Time getTimeComponent()
public TimeStamp addDays(long days)
days -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||