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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an event (a variable taking a certain value) to the state.void
Adds events to the state.boolean
Returns the events of the state.Returns the names of the variables collected by theState
object.String[]
Returns all the values in the State.getValueVariable
(String nameVariable) Returns the value for a specific variable.int
hashCode()
void
modifyEventValue
(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
-State
to 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 theState
object.- 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
-