Interface ParameterizedData

    • Method Detail

      • getParameterCount

        int getParameterCount()
        Gets the number of parameters.

        This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.

        Returns:
        the number of parameters
      • getParameter

        double getParameter​(int parameterIndex)
        Gets the value of the parameter at the specified index.
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the value of the parameter
        Throws:
        IndexOutOfBoundsException - if the index is invalid
      • getParameterMetadata

        ParameterMetadata getParameterMetadata​(int parameterIndex)
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
        Throws:
        IndexOutOfBoundsException - if the index is invalid
      • findParameterIndex

        default OptionalInt findParameterIndex​(ParameterMetadata metadata)
        Finds the parameter index of the specified metadata.

        If the parameter metadata is not matched, an empty optional will be returned.

        Parameters:
        metadata - the parameter metadata to find the index of
        Returns:
        the index of the parameter
      • withParameter

        ParameterizedData withParameter​(int parameterIndex,
                                        double newValue)
        Returns a copy of the data with the value at the specified index altered.

        This instance is immutable and unaffected by this method call.

        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        newValue - the new value for the specified parameter
        Returns:
        a parameterized data instance based on this with the specified parameter altered
        Throws:
        IndexOutOfBoundsException - if the index is invalid
      • withPerturbation

        default ParameterizedData withPerturbation​(ParameterPerturbation perturbation)
        Returns a perturbed copy of the data.

        The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.

        This instance is immutable and unaffected by this method call.

        Parameters:
        perturbation - the perturbation to apply
        Returns:
        a parameterized data instance based on this with the specified perturbation applied