Class ListParameterization

  • All Implemented Interfaces:
    Parameterization

    public class ListParameterization
    extends AbstractParameterization
    Parameterization handler using a List and OptionIDs, for programmatic use.
    Since:
    0.3
    Author:
    Erich Schubert
    • Constructor Detail

      • ListParameterization

        public ListParameterization()
        Default constructor.
      • ListParameterization

        public ListParameterization​(java.util.Collection<ListParameterization.ParameterPair> dbParameters)
        Constructor with an existing collection.
        Parameters:
        dbParameters - existing parameter collection
    • Method Detail

      • addFlag

        public ListParameterization addFlag​(OptionID optionid)
        Add a flag to the parameter list
        Parameters:
        optionid - Option ID
        Returns:
        this, for chaining
      • addFlag

        public ListParameterization addFlag​(java.lang.String optionid)
        Add a flag to the parameter list
        Parameters:
        optionid - Option ID
        Returns:
        this, for chaining
      • addParameter

        public ListParameterization addParameter​(OptionID optionid,
                                                 java.lang.Object value)
        Add a parameter to the parameter list
        Parameters:
        optionid - Option ID
        value - Value
        Returns:
        this, for chaining
      • addParameter

        public ListParameterization addParameter​(java.lang.String optionid,
                                                 java.lang.Object value)
        Add a parameter to the parameter list
        Parameters:
        optionid - Option ID
        value - Value
        Returns:
        this, for chaining
      • setValueForOption

        public boolean setValueForOption​(Parameter<?> opt)
                                  throws ParameterException
        Description copied from interface: Parameterization
        Assign a value for an option, but not using default values and throwing exceptions on error.
        Parameters:
        opt - Parameter to set
        Returns:
        Success code
        Throws:
        ParameterException - on assignment errors.
      • getRemainingParameters

        public java.util.List<ListParameterization.ParameterPair> getRemainingParameters()
        Return the yet unused parameters.
        Returns:
        Unused parameters.
      • hasUnusedParameters

        public boolean hasUnusedParameters()
        Description copied from interface: Parameterization
        Check for unused parameters
        Returns:
        true if at least one parameter was not consumed
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • serialize

        public java.util.ArrayList<java.lang.String> serialize()
        Serialize parameters.
        Returns:
        Array list of parameters