java.lang.Object
es.upm.fi.cig.multictbnc.data.representation.State
Represents the state of certain nodes/variables (events) by keeping their names and values. A certain state can only
contain one event for each variable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an event (a variable taking a certain value) to the state.voidAdds events to the state.booleanReturns the events of the state.Returns the names of the variables collected by theStateobject.String[]Returns all the values in the State.getValueVariable(String nameVariable) Returns the value for a specific variable.inthashCode()voidmodifyEventValue(String nameVariable, String newValue) Modifies the value of a given variable.toString()
-
Constructor Details
-
State
public State()Default constructor. -
State
Creates a State instance with some events.- Parameters:
events- events to include to the State
-
State
Creates a State instance with one event.- Parameters:
nameVariable- name of the variablevalueVariable- value of the variable
-
State
Constructor to clone states;- Parameters:
state-Stateto clone
-
-
Method Details
-
addEvent
Adds an event (a variable taking a certain value) to the state.- Parameters:
nameVariable- name of the variablevalueVariable- value of the variable
-
addEvents
Adds events to the state.- Parameters:
events- events to add
-
getEvents
Returns the events of the state.- Returns:
- Map with events
-
getNameVariables
Returns the names of the variables collected by theStateobject.- Returns:
- names of the variables
-
getValueVariable
Returns the value for a specific variable. Null is returned if the variable is not present.- Parameters:
nameVariable- name of the variable- Returns:
- value of the specified node for this state
-
getValues
Returns all the values in the State.- Returns:
- value of the specified node for this state
-
modifyEventValue
Modifies the value of a given variable.- Parameters:
nameVariable- name of the variablenewValue- new value for the variable in this state
-
hashCode
public int hashCode() -
equals
-
toString
-