|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.util.TimeStampedValue
public final class TimeStampedValue
Simple wrapper around a time in ms and a value Object.
The key is the time in ms and may be used in a Map.
compares the key.
compareTo(TimeStampedValue)
Constructor Summary | |
---|---|
TimeStampedValue(long key,
java.lang.Object value)
Creates an instance with the given timestamp key and the value to time stamp. |
|
TimeStampedValue(java.lang.Object value)
Creates an instance for the given value that is time stamped with the current time. |
Method Summary | |
---|---|
int |
compareTo(TimeStampedValue obj)
Compares the given TimeStampedValue to this by the internal
getTime() . |
boolean |
equals(java.lang.Object obj)
|
java.lang.Long |
getKey()
Returns the Long that marks the time stamp (difference, measured in
milliseconds, between the current time and midnight, January 1, 1970 UTC). |
long |
getTime()
Returns the time stamp (difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC). |
java.lang.Object |
getValue()
Returns the time stamp. |
int |
hashCode()
|
boolean |
isPast()
Returns whether the internal time stamp marks a time in the past or not. |
java.lang.Object |
setValue(java.lang.Object value)
Assigns a different value to the timestamp. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeStampedValue(long key, java.lang.Object value)
key
- the time stamp (difference, measured in milliseconds, between the
current time and midnight, January 1, 1970 UTC).value
- the value to time stamp.public TimeStampedValue(java.lang.Object value)
value
- the value to time stamp.System.currentTimeMillis()
Method Detail |
---|
public int compareTo(TimeStampedValue obj)
TimeStampedValue
to this by the internal
getTime()
.
compareTo
in interface java.lang.Comparable<TimeStampedValue>
obj
- the object to compare this to.
Comparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map.Entry<java.lang.Long,java.lang.Object>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.Long getKey()
Long
that marks the time stamp (difference, measured in
milliseconds, between the current time and midnight, January 1, 1970 UTC).
getKey
in interface java.util.Map.Entry<java.lang.Long,java.lang.Object>
Long
that marks the time stamp (difference, measured in
milliseconds, between the current time and midnight, January 1,
1970 UTC).Map.Entry.getKey()
public long getTime()
public java.lang.Object getValue()
getValue
in interface java.util.Map.Entry<java.lang.Long,java.lang.Object>
Map.Entry.getValue()
public int hashCode()
hashCode
in interface java.util.Map.Entry<java.lang.Long,java.lang.Object>
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isPast()
For normal a time stamp represents a value regarded at a time. But it is also thinkable to mark a value for expiration in the future. This method returns true if the internal time- representing key is smaller than the actual time.
public java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry<java.lang.Long,java.lang.Object>
value
- the new value to be marked with this timestamp.
Map.Entry.setValue(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |