Class VariableReference

  • All Implemented Interfaces:
    Cloneable

    public final class VariableReference
    extends Object
    implements Cloneable
    Identifies a Variable and data binding information.
    • Constructor Detail

      • VariableReference

        public VariableReference​(Variable variable,
                                 ColumnValueType columnValueType,
                                 String column)
        Initializes a new instance of the VariableReference class.
        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 the VariableReference class.
        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 the VariableReference class.
        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 the VariableReference class.
        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.