|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.multi.utils.timekey.TimeKey
public class TimeKey
the TimeKey class makes sure that for every integer time there is only one instance of the TimeKey object. The inner structure of active is implemented via a WeakHashMap. This means that if a process loses reference for the TimeKey object, it can be garbage collected.
Nested Class Summary | |
---|---|
static class |
TimeKey.TimeKeyComparator
|
Field Summary | |
---|---|
protected static java.util.Map<java.lang.Long,java.lang.ref.WeakReference<TimeKey>> |
keys
|
Method Summary | |
---|---|
static void |
clear()
Wipes out case with time keys. |
int |
compareTo(java.lang.Object key)
|
boolean |
equals(java.lang.Object other)
|
static boolean |
exists(long time)
Checks if a TimeKey instance exists for the integer time. |
protected void |
finalize()
|
static TimeKey |
get(long time)
Returns the TimeKey object for the required time. |
static java.util.List<java.lang.ref.WeakReference<TimeKey>> |
getAllKeys()
|
static ImmutableFlag<java.lang.Integer> |
getInstances()
|
long |
getTime()
returns the integer time for this timekey. |
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.util.Map<java.lang.Long,java.lang.ref.WeakReference<TimeKey>> keys
Method Detail |
---|
public static ImmutableFlag<java.lang.Integer> getInstances()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public static TimeKey get(long time)
time
-
public static void clear()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static boolean exists(long time)
time
-
public long getTime()
public int compareTo(java.lang.Object key)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.List<java.lang.ref.WeakReference<TimeKey>> getAllKeys()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |