|
||||||||||
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.TimeKeyManager
public class TimeKeyManager
Singleton class that manages timekey locks and unlocks,
Method Summary | |
---|---|
static TimeKeyManager |
get()
|
Set<Long> |
getHeldKeys()
Returns an immutable collection of currently held timeKeys. |
String |
getHeldKeysStr()
Returns an immutable collection of currently held timeKeys as string. |
boolean |
isLocked(long time)
True if the provided timeKey is explicitly locked (lock(key) was called). |
boolean |
isLocked(TimeKey key)
True if the provided timeKey is explicitly locked (lock(key) was called). |
void |
lock(long key)
Locks some "time" (or increment lock number if existing lock exists). |
void |
unlock(long key)
Unlocks some "time". |
void |
unlockAll()
Unlock all times. |
void |
unlockAll(long key)
Completely unlocks one time (regardless number of locks held). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Set<Long> getHeldKeys()
ITimeKeyManager
getHeldKeys
in interface ITimeKeyManager
public String getHeldKeysStr()
ITimeKeyManager
getHeldKeysStr
in interface ITimeKeyManager
public static TimeKeyManager get()
public boolean isLocked(TimeKey key)
ITimeKeyManager
isLocked
in interface ITimeKeyManager
public boolean isLocked(long time)
ITimeKeyManager
isLocked
in interface ITimeKeyManager
public void unlock(long key) throws TimeKeyNotLockedException
ITimeKeyManager
unlock
in interface ITimeKeyManager
TimeKeyNotLockedException
public void unlockAll(long key) throws TimeKeyNotLockedException
ITimeKeyManager
unlockAll
in interface ITimeKeyManager
TimeKeyNotLockedException
public void lock(long key)
ITimeKeyManager
lock
in interface ITimeKeyManager
public void unlockAll()
ITimeKeyManager
unlockAll
in interface ITimeKeyManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |