Constructor and Description |
---|
HashMapMemory(java.util.Collection<java.lang.String> variableNames)
Constructs an empty (values of variables are equal to
null ) hash map-based store of
variables. |
HashMapMemory(HashMapMemory memory)
Constructs hash map-based store of variables as a copy of the specified
HashMapMemory
instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsVariable(java.lang.String name)
Checks if the specified variable is stored in this memory.
|
boolean |
equals(java.lang.Object obj) |
ru.ispras.fortress.expression.NodeValue |
getValue(java.lang.String name)
Returns a value of the specified variable.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getValues()
Returns a values of all stored variables.
|
int |
hashCode() |
void |
reset()
Sets all variables of this memory to the same values as they had immediately after the memory
construction.
|
void |
setValue(java.lang.String name,
ru.ispras.fortress.expression.NodeValue value)
Sets a variable with the specified name to the specified value.
|
void |
setValues(java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> values)
Sets variables with the specified names to the specified values.
|
java.lang.String |
toString() |
public HashMapMemory(java.util.Collection<java.lang.String> variableNames)
null
) hash map-based store of
variables.variableNames
- a collection of names of variables to be storedpublic HashMapMemory(HashMapMemory memory)
HashMapMemory
instance.memory
- the memory to be copiedpublic void setValue(java.lang.String name, ru.ispras.fortress.expression.NodeValue value)
Memory
public void setValues(java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> values)
Memory
public boolean containsVariable(java.lang.String name)
Memory
containsVariable
in interface Memory
name
- a variable nametrue
if this memory contains a value of the specified variable. Otherwise
returns false
public ru.ispras.fortress.expression.NodeValue getValue(java.lang.String name)
Memory
public java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getValues()
Memory
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object