Class ResultPiecewiseFunctionValue

java.lang.Object
com.amalgamasimulation.studies.result.ResultElement
com.amalgamasimulation.studies.result.ResultPiecewiseFunctionValue
All Implemented Interfaces:
ResultValue

public class ResultPiecewiseFunctionValue extends ResultElement implements ResultValue
A result element representing a piecewise function value. Extends ResultElement and implements ResultValue to provide piecewise function storage and display capabilities within a hierarchical result structure.

This class supports the storage of a PiecewiseFunction and formatting configuration through DoubleFormats.

  • Constructor Details

    • ResultPiecewiseFunctionValue

      public ResultPiecewiseFunctionValue(PiecewiseFunction value)
      Constructs a new ResultPiecewiseFunctionValue with the specified piecewise function.
      Parameters:
      value - the piecewise function value (cannot be null)
      Throws:
      NullPointerException - if the value parameter is null
  • Method Details

    • value

      public PiecewiseFunction value()
      Gets the PiecewiseFunction value of this element.
      Specified by:
      value in interface ResultValue
      Returns:
      the piecewise function value
    • format

      public Function<Double,String> format()
      Gets the current formatter function based on the configured format. The formatter will be used to format numeric outputs from the piecewise function. Default format DoubleFormats.KMB.
      Returns:
      a function that formats double values according to the current format
    • format

      Sets the display format for numeric outputs from this piecewise function.
      Parameters:
      format - the format to use (cannot be null)
      Returns:
      this element for method chaining
      Throws:
      NullPointerException - if the format parameter is null
    • getFormat

      public DoubleFormats getFormat()
      Gets the current display format for numeric outputs. Default format DoubleFormats.KMB.
      Returns:
      the current format setting
    • id

      Description copied from class: ResultElement
      Sets the identifier for this element. The ID must be unique among siblings.
      Overrides:
      id in class ResultElement
      Parameters:
      id - the unique identifier for this element
      Returns:
      this element for method chaining