public class Transaction
extends java.lang.Object
NodeValue
class. A second one is a constraint-based description
represented by the NodeOperation
class.NodeValue
,
NodeOperation
Constructor and Description |
---|
Transaction()
Constructs an empty transaction.
|
Transaction(int size)
Constructs an empty transaction with the specified initial capacity of an underlying collection
of variable name-value pairs.
|
Transaction(java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> values)
Constructs a transaction containing the specified name-value pairs.
|
Modifier and Type | Method and Description |
---|---|
void |
addVariable(java.lang.String name,
ru.ispras.fortress.expression.NodeValue value)
Adds a variable with the specified name and value to this transaction.
|
boolean |
containsVariable(java.lang.String name)
Checks if the specified variable is in this transaction.
|
boolean |
equals(java.lang.Object object)
Compares the specified object with this transaction for equality.
|
ru.ispras.fortress.expression.NodeValue |
getValue(java.lang.String variableName)
Returns a value of the specified variable from this transaction.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getValues()
Returns a map containing mappings between names
and values for all variables of this transaction.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if this transaction is empty.
|
java.lang.String |
toString() |
public Transaction()
public Transaction(java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> values)
values
- a map containing mappings between variables' names and valuespublic Transaction(int size)
size
- the initial capacitypublic void addVariable(java.lang.String name, ru.ispras.fortress.expression.NodeValue value)
name
- the name of the variable to be addedvalue
- the value of the variable to be addedpublic ru.ispras.fortress.expression.NodeValue getValue(java.lang.String variableName)
variableName
- a name of the variablenull
public java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getValues()
public boolean containsVariable(java.lang.String name)
name
- a name of the variable to be checkedtrue
if this transaction contains the specified variable. Otherwise returns
false
.public boolean isEmpty()
true
if this transaction contains no variables. Otherwise returns false
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
Transaction
class or its subclass;
equals
in class java.lang.Object
object
- the object to be compared for equality with this transactiontrue
if the specified object is equal to this transaction; otherwise, returns
false
public java.lang.String toString()
toString
in class java.lang.Object