Interface AxisDescription

  • All Known Implementing Classes:
    DefaultAxisDescription

    public interface AxisDescription
    Axis description containing the axis name, its unit as well as its minimum and maximum range.

    N.B. this description is given per dimension (ie. one for "X" and one for "Y" for a typical X-Y dataset/plot)

    example usages: [..].setName("x-axis"); // for setting only the name [..].setName("time", "s"); // for setting the axis name and unit [..].setName("voltage", "V", 0.0, 230.0); // for setting the axis name, unit and explicit min/max values [..].setName("intensity", "ppp", 1e9, 1e10, 1e8, 1e11); // or [..].setName("intensity", "ppp", intensityRange); // for an unsorted range list based on which the internal min/max range is updated.

    Author:
    akrimm, rstein
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean add​(double value)
      Adds value to this range.
      default boolean add​(double[] values)
      Adds values to this range.
      boolean add​(double[] values, int nlength)
      Adds values to this range.
      boolean clear()
      Empties this DataRange.
      boolean contains​(double value)  
      double getLength()  
      double getMax()  
      double getMin()  
      java.lang.String getName()  
      java.lang.String getUnit()  
      boolean isDefined()
      Determines if axis range is defined - ie.
      boolean set​(double min, double max)
      Sets min and max values for this range.
      default boolean set​(AxisDescription range)
      Sets updates this AxisDescription with the specified other one.
      boolean set​(java.lang.String axisName, java.lang.String... axisUnit)  
      boolean set​(java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)  
      boolean setMax​(double max)
      Sets max value for this range.
      boolean setMin​(double min)
      Sets min value for this range.
    • Method Detail

      • add

        boolean add​(double value)
        Adds value to this range.
        Parameters:
        value - value to be added
        Returns:
        true if the value becomes min or max.
      • add

        default boolean add​(double[] values)
        Adds values to this range.
        Parameters:
        values - values to be added
        Returns:
        true if the value becomes min or max.
      • add

        boolean add​(double[] values,
                    int nlength)
        Adds values to this range.
        Parameters:
        values - values to be added
        nlength - the maximum array length that should be taken into account
        Returns:
        true if the value becomes min or max.
      • clear

        boolean clear()
        Empties this DataRange. After calling this method this data range becomes undefined.
        Returns:
        true if the values were valid before
        See Also:
        isDefined()
      • contains

        boolean contains​(double value)
      • getLength

        double getLength()
      • getMax

        double getMax()
        Returns:
        maximum value of the axis or DataSet
      • getMin

        double getMin()
        Returns:
        minimum value of the axis or DataSet
      • getName

        java.lang.String getName()
        Returns:
        axis name
      • getUnit

        java.lang.String getUnit()
        Returns:
        the unit of the axis, typically in SI units such as 's', 'V' etc. or 'a.u.'
      • isDefined

        boolean isDefined()
        Determines if axis range is defined - ie. if min and max values are defined.
        Returns:
        true if range is well defined
      • set

        default boolean set​(AxisDescription range)
        Sets updates this AxisDescription with the specified other one.
        Parameters:
        range - other AxisDescription object
        Returns:
        true if the value becomes min or max.
      • set

        boolean set​(double min,
                    double max)
        Sets min and max values for this range.
        Parameters:
        min - new minimum of the range
        max - new maximum of the range
        Returns:
        true if the values becomes the new min or max.
      • set

        boolean set​(java.lang.String axisName,
                    java.lang.String axisUnit,
                    double rangeMin,
                    double rangeMax)
        Parameters:
        axisName - the new axis name
        axisUnit - the new axis unit
        rangeMin - the user-provided new minimum value of the DataSet/Axis range
        rangeMax - the user-provided new maximum value of the DataSet/Axis range
        Returns:
        true if this setter invalidates the existing min/max range
        See Also:
        event if only the name/unit changed, or, event if only the range changed, or, for a full change
      • setMax

        boolean setMax​(double max)
        Sets max value for this range.
        Parameters:
        max - the new max value
        Returns:
        true if the value becomes the new max.
      • setMin

        boolean setMin​(double min)
        Sets min value for this range.
        Parameters:
        min - the new max value
        Returns:
        true if the value becomes the new min.