Interface IParameters

    • Method Detail

      • copy

        default IParameters copy()
        Creates a new IParameters object and populates it with the parameters
      • reset

        void reset()
        Reset the parameters to their default values.
      • toString

        String toString()
        Converts the parameters into a string.
        Overrides:
        toString in class Object
        Returns:
        the string holding all the parameters.
      • fromString

        void fromString​(String data)
        Parses the parameters stored into a string back into the object.
        Parameters:
        data - the string holding the parameters. It must be formatted as the string generated by toString(). Line-breaks must be normalized to '\n'. It can also be null or empty, in such case the parameters are left with their current values. Use reset() to reset the parameters to their defaults.
      • load

        void load​(URL inputURL,
                  boolean ignoreErrors)
        Loads the parameters from a file.
        Parameters:
        inputURL - URL of the parameters file to load.
        ignoreErrors - true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.
      • load

        void load​(InputStream inStream,
                  boolean ignoreErrors)
        Loads the parameters from a file.
        Parameters:
        inStream - input stream with the parameters to load.
        ignoreErrors - true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.
      • save

        void save​(String filePath)
        Saves the parameters to a file.
        Parameters:
        filePath - the full path of the parameters file to save.
      • getPath

        String getPath()
        Gets the full path of the last file where the parameters where loaded from or saved to.
        Returns:
        the full path of the last load() or save(), or null if object was not loaded nor saved.
      • setPath

        void setPath​(String filePath)
        Sets the full path of the file where the parameters are to be saved to.
        Parameters:
        filePath - the full path to set.
      • getBoolean

        boolean getBoolean​(String name)
        Gets the boolean value for the given parameter name.
        Parameters:
        name - the name of the boolean parameter to retrieve.
        Returns:
        the value of the given parameter, or false if it is not defined.
      • setBoolean

        void setBoolean​(String name,
                        boolean value)
        Sets the boolean value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • getString

        String getString​(String name)
        Gets the string value for a given parameter name.
        Parameters:
        name - the name of the string parameter to retrieve.
        Returns:
        the value of the given parameter, or null if it is not defined.
      • setString

        void setString​(String name,
                       String value)
        Sets the string value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • getInteger

        int getInteger​(String name)
        Gets the integer value for a given parameter name.
        Parameters:
        name - the name of the integer parameter to retrieve.
        Returns:
        the value of the given parameter, or 0 if it is not defined.
      • setInteger

        void setInteger​(String name,
                        int value)
        Sets the integer value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • getParametersDescription

        ParametersDescription getParametersDescription()
        Gets the description of the parameters.
        Returns:
        the ParametersDescription object for this set of parameters, or null if none is provided.