Package com.bayesserver.data
Class VariableReference
- java.lang.Object
-
- com.bayesserver.data.VariableReference
-
-
Constructor Summary
Constructors Constructor Description VariableReference(Variable variable, ColumnValueType columnValueType, String column)Initializes a new instance of theVariableReferenceclass.VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction)Initializes a new instance of theVariableReferenceclass.VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction, EmptyStringAction emptyStringAction)Initializes a new instance of theVariableReferenceclass.VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction, EmptyStringAction emptyStringAction, String interventionColumn)Initializes a new instance of theVariableReferenceclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariableReferencecopy(Variable newVariable)Creates a copy of this instance, but based on a different variable.StringgetColumn()Gets the name of the relevant column in the data source.ColumnValueTypegetColumnValueType()Gets the type of value in the bound data column.EmptyStringActiongetEmptyStringAction()Determines the action to take if an empty string is encountered.StringgetInterventionColumn()Gets the optional name of a column in the data source that identifies whether this is an intervention (Do evidence) or not.StateNotFoundActiongetStateNotFoundAction()Determines the action to take if the name or value from the data cannot be matched to a particular state for this reference variable.VariablegetVariable()Gets the variable.
-
-
-
Constructor Detail
-
VariableReference
public VariableReference(Variable variable, ColumnValueType columnValueType, String column)
Initializes a new instance of theVariableReferenceclass.- Parameters:
variable- The variable.columnValueType- The type of column to bind to.column- The name of the column in the data source.
-
VariableReference
public VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction)
Initializes a new instance of theVariableReferenceclass.- Parameters:
variable- The variable.columnValueType- The type of column to bind to.column- The name of the column in the data source.stateNotFoundAction- The action to take if a state name/value cannot be mapped to a state.
-
VariableReference
public VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction, EmptyStringAction emptyStringAction)
Initializes a new instance of theVariableReferenceclass.- Parameters:
variable- The variable.columnValueType- The type of column to bind to.column- The name of the column in the data source.stateNotFoundAction- The action to take if a state name/value cannot be mapped to a state.emptyStringAction- The action to take if an empty string is detected.
-
VariableReference
public VariableReference(Variable variable, ColumnValueType columnValueType, String column, StateNotFoundAction stateNotFoundAction, EmptyStringAction emptyStringAction, String interventionColumn)
Initializes a new instance of theVariableReferenceclass.- Parameters:
variable- The variable.columnValueType- The type of column to bind to.column- The name of the column in the data source.stateNotFoundAction- The action to take if a state name/value cannot be mapped to a state.emptyStringAction- The action to take if an empty string is detected.interventionColumn- Optional column which determines whether this is an intervention or not.
-
-
Method Detail
-
copy
public VariableReference copy(Variable newVariable)
Creates a copy of this instance, but based on a different variable.- Parameters:
newVariable- The new variable to reference.- Returns:
- A new instance of a VariableReference.
-
getStateNotFoundAction
public StateNotFoundAction getStateNotFoundAction()
Determines the action to take if the name or value from the data cannot be matched to a particular state for this reference variable.
-
getEmptyStringAction
public EmptyStringAction getEmptyStringAction()
Determines the action to take if an empty string is encountered.
-
getColumn
public String getColumn()
Gets the name of the relevant column in the data source.- Returns:
- The name of the column.
-
getColumnValueType
public ColumnValueType getColumnValueType()
Gets the type of value in the bound data column.- Returns:
- The type of value in the column.
-
getVariable
public Variable getVariable()
Gets the variable.- Returns:
- The variable.
-
getInterventionColumn
public String getInterventionColumn()
Gets the optional name of a column in the data source that identifies whether this is an intervention (Do evidence) or not.- Returns:
- The name of the intervention column.
-
-