uk.ac.starlink.hapi

## Interface HapiBins

-     public interface HapiBins

  Characterises the bins information of a HAPI parameter. One but not both of the `getRanges()` and `getCenters()` methods is supposed to return null.
  Since:
    12 Feb 2024
  See Also:
    HAPI 3.1, sec 3.6.11

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HapiBins` | `fromJson(org.json.JSONObject json)` Reads HapiBins from a HAPI bins json object.
    `double[]` | `getCenters()` Returns an array giving the centers of each bin.
    `java.lang.String` | `getDescription()` Returns a description of what the bins represent.
    `java.lang.String` | `getLabel()` Returns a human-readable label for bins axis.
    `java.lang.String` | `getName()` Name for the dimension.
    `double[][]` | `getRanges()` Returns an array of 2-element arrays giving (low,high) bounds of each bin.
    `java.lang.String` | `getUnits()` Returns the units of bin centers or ranges.

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Name for the dimension.
      Returns:
        name

    - #### getCenters

          double[] getCenters()

      Returns an array giving the centers of each bin. May be null if ranges has a value.
      Returns:
        bin centers

    - #### getRanges

          double[][] getRanges()

      Returns an array of 2-element arrays giving (low,high) bounds of each bin. May be null if centers has a value.
      Returns:
        array of 2-element arrays

    - #### getUnits

          java.lang.String getUnits()

      Returns the units of bin centers or ranges.
      Returns:
        units string

    - #### getLabel

          java.lang.String getLabel()

      Returns a human-readable label for bins axis.
      Returns:
        label or null

    - #### getDescription

          java.lang.String getDescription()

      Returns a description of what the bins represent.
      Returns:
        description or null

    - #### fromJson

          static HapiBins fromJson(org.json.JSONObject json)

      Reads HapiBins from a HAPI bins json object.
      Parameters:
        `json` - JSON object
      Returns:
        bins object, not null