|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.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 Map<Long,WeakReference<TimeKey>> |
keys
|
| Method Summary | |
|---|---|
static void |
clear()
Wipes out case with time keys. |
int |
compareTo(Object key)
|
boolean |
equals(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 List<WeakReference<TimeKey>> |
getAllKeys()
|
static cz.cuni.amis.utils.flag.ImmutableFlag<Integer> |
getInstances()
|
long |
getTime()
returns the integer time for this timekey. |
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static Map<Long,WeakReference<TimeKey>> keys
| Method Detail |
|---|
public static cz.cuni.amis.utils.flag.ImmutableFlag<Integer> getInstances()
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic static TimeKey get(long time)
time -
public static void clear()
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic static boolean exists(long time)
time -
public long getTime()
public int compareTo(Object key)
compareTo in interface Comparablepublic String toString()
toString in class Objectpublic static List<WeakReference<TimeKey>> getAllKeys()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||