orc.runtime
Class Globals<H,V>
java.lang.Object
orc.runtime.Globals<H,V>
- Type Parameters:
H
- handle typeV
- value type
public class Globals<H,V>
- extends java.lang.Object
Holds references to objects identified by unique string keys.
Each key is associated with a handle; a handle's keys can be deleted
en masse.
- Author:
- quark
Method Summary |
java.lang.String |
add(H handle,
V value)
Store a global, generating a unique name. |
V |
get(java.lang.String key)
|
boolean |
put(H handle,
java.lang.String key,
V value)
Store a global, using an existing name. |
V |
remove(java.lang.String key)
|
void |
removeAll(H handle)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Globals
public Globals()
add
public java.lang.String add(H handle,
V value)
- Store a global, generating a unique name.
put
public boolean put(H handle,
java.lang.String key,
V value)
- Store a global, using an existing name. Only use this
if you are confident the name is globally unique, i.e.
it's some form of GUID. Returns false if the key is already
in use.
get
public V get(java.lang.String key)
remove
public V remove(java.lang.String key)
removeAll
public void removeAll(H handle)