|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.micropsi.nodenet.InnerStateContainer
InnerStateContainers contain the published (and persistent) inner states of an native
module implementation.
What "published" actually means is that the native module implementation uses its
innerstate object for storing variables.
| Constructor Summary | |
protected |
InnerStateContainer()
|
| Method Summary | |
boolean |
changeInnerState(java.lang.String key,
java.lang.String value)
Changes an inner state if, and only if, the module already created the state. |
void |
ensureStateExistence(java.lang.String key,
java.lang.String defaultValue)
This ensures that an inner state exists. |
java.lang.String |
getInnerState(java.lang.String key)
Returns the value of an inner state by it's key. |
java.lang.String[] |
getInnerStates()
Returns an array with the inner state's keys. |
java.lang.String |
getInspectionString()
Returns a String that describes the inner state of the module, inculding the classname and all persistent states (key/value) |
protected java.util.HashMap |
getMap()
Returns the map of inner states for saving them |
double |
getStateDouble(java.lang.String key)
Returns a state as a double. |
int |
getStateInt(java.lang.String key)
Returns a state as an int. |
long |
getStateLong(java.lang.String key)
Returns a state as a long. |
java.lang.String |
getStateString(java.lang.String key)
Returns a state as a String. |
protected void |
setMap(java.util.HashMap map)
Sets the map of inner states after loading them from somewhere |
void |
setState(java.lang.String key,
double value)
Sets a state. |
void |
setState(java.lang.String key,
int value)
Sets a state. |
void |
setState(java.lang.String key,
long value)
Sets a state. |
void |
setState(java.lang.String key,
java.lang.String value)
Sets a state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected InnerStateContainer()
| Method Detail |
protected java.util.HashMap getMap()
protected void setMap(java.util.HashMap map)
map - the inner states
public void setState(java.lang.String key,
java.lang.String value)
key - the state's keyvalue - the value
public void setState(java.lang.String key,
long value)
key - the state's keyvalue - the value
public void setState(java.lang.String key,
double value)
key - the state's keyvalue - the value
public void setState(java.lang.String key,
int value)
key - the state's keyvalue - the valuepublic java.lang.String getStateString(java.lang.String key)
key - the key of the state to be retrieved
public long getStateLong(java.lang.String key)
key - the key of the state to be retrieved
public double getStateDouble(java.lang.String key)
key - the key of the state to be retrieved
public int getStateInt(java.lang.String key)
key - the key of the state to be retrieved
public java.lang.String[] getInnerStates()
InnerStateInspectorIF
getInnerStates in interface InnerStateInspectorIFInnerStateInspectorIF.getInnerStates()public java.lang.String getInspectionString()
InnerStateInspectorIF
getInspectionString in interface InnerStateInspectorIFInnerStateInspectorIF.getInspectionString()public java.lang.String getInnerState(java.lang.String key)
InnerStateInspectorIF
getInnerState in interface InnerStateInspectorIFkey - the key
InnerStateInspectorIF.getInnerState(String)
public boolean changeInnerState(java.lang.String key,
java.lang.String value)
InnerStateInspectorIF
changeInnerState in interface InnerStateInspectorIFkey - the state's keyvalue - the new value
InnerStateInspectorIF.changeInnerState(String, String)
public void ensureStateExistence(java.lang.String key,
java.lang.String defaultValue)
key - the key of the valuedefaultValue - the default value
|
(c) by Micropsi Project: http://www.cognitive-agents.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||