public class TimeKeyManager extends Object
Modifier and Type | Method and Description |
---|---|
static TimeKeyManager |
get()
Get the singleton instance.
|
Collection<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) |
void |
unlock(long key) |
void |
unlockAll()
Unlock all keys.
|
void |
unlockAll(long key)
Completely unlocks one key (regardles number of locks held).
|
public Collection<Long> getHeldKeys()
public String getHeldKeysStr()
public static TimeKeyManager get()
public boolean isLocked(TimeKey key)
key
- public boolean isLocked(long time)
time
- public void unlock(long key) throws TimeKeyNotLockedException
TimeKeyNotLockedException
public void unlockAll(long key) throws TimeKeyNotLockedException
key
- TimeKeyNotLockedException
public void lock(long key)
public void unlockAll()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.