public class VariableRegistry extends Object
Constructor and Description |
---|
VariableRegistry()
Create a new instance.
|
VariableRegistry(Map<String,Variable> value)
Create a new instance and use the given map (which will be modified).
|
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableMap<String,Variable> |
asMap()
Get the registry as an immutable map
|
void |
clean() |
Variable |
get(String key) |
float |
getFloat(String key)
Get the variable with the given key as an integer, if possible
|
int |
getInt(String key)
Get the variable with the given key as an integer, if possible
|
Variable |
getOrDefault(String key,
Variable def) |
String |
getString(String key) |
boolean |
has(String key) |
void |
put(String key,
Variable value)
Put the given key and variable into the registry.
|
void |
putAll(Map<String,? extends Variable> value)
Put all the entries from the given map into the registry
|
void |
putFloat(String key,
float value)
Put the given key and value into the registry as a
IntVariable . |
void |
putInt(String key,
int value)
Put the given key and value into the registry as a
IntVariable . |
void |
putObject(String key,
Object value)
Put the given key and value into the registry as an object.
|
void |
putString(String key,
String value)
Put the given key and value into the registry as a
StringVariable . |
void |
remove(String key)
Remove the given entry from the registry, if it exists
|
void |
unload() |
public void put(String key, Variable value)
key
- they keyvalue
- the valuepublic void putAll(Map<String,? extends Variable> value)
value
- the map of variablespublic void remove(String key)
key
- public boolean has(String key)
public void putInt(String key, int value)
IntVariable
.key
- they keyvalue
- the valuepublic int getInt(String key)
key
- public void putString(String key, String value)
StringVariable
.key
- they keyvalue
- the valuepublic void putFloat(String key, float value)
IntVariable
.key
- they keyvalue
- the valuepublic float getFloat(String key)
key
- public void putObject(String key, Object value)
key
- they keyvalue
- the valuepublic com.google.common.collect.ImmutableMap<String,Variable> asMap()
public void clean()
public void unload()
Copyright © 2020. All rights reserved.