Package net.paulhertz.pixelaudio.io

# Class PACurveMakerIO

java.lang.Object
net.paulhertz.pixelaudio.io.PACurveMakerIO

public final class PACurveMakerIO extends Object
JSON read/write support for PACurveMaker. Filename convention suggestion: gesture_001_gesture.json Used in the example sketch `Bagatelle`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `PACurveMakerIO.Meta`
  `static final class`
  `PACurveMakerIO.Result`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FORMAT`
  `static final int`
  `VERSION`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `private`
  `PACurveMakerIO()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static PACurveMakerIO.Result`
  `fromJson(processing.data.JSONObject root)`
  `private static processing.data.JSONArray`
  `intsToJson(int[] values)`
  `private static ArrayList<Integer>`
  `jsonToIntsList(processing.data.JSONArray arr)`
  `private static ArrayList<processing.core.PVector>`
  `jsonToPoints(processing.data.JSONArray arr)`
  `private static String`
  `nonNull(String value, String fallback)`
  `private static processing.data.JSONArray`
  `pointsToJson(List<processing.core.PVector> points)`
  `private static void`
  `putIfPresent(processing.data.JSONObject obj, String key, String value)`
  `static PACurveMakerIO.Result`
  `read(File file)`
  `private static void`
  `requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion)`
  `static processing.data.JSONObject`
  `toJson(PACurveMaker curve, PACurveMakerIO.Meta meta)`
  `static void`
  `write(File file, PACurveMaker curve, PACurveMakerIO.Meta meta)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### FORMAT

    public static final String FORMAT
    See Also:
      - Constant Field Values

  - ### VERSION

    public static final int VERSION
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### PACurveMakerIO

    private PACurveMakerIO()

- ## Method Details

  - ### toJson

    public static processing.data.JSONObject toJson(PACurveMaker curve, PACurveMakerIO.Meta meta)

  - ### write

    public static void write(File file, PACurveMaker curve, PACurveMakerIO.Meta meta) throws IOException
    Throws:
      `IOException`

  - ### read

    public static PACurveMakerIO.Result read(File file) throws IOException
    Throws:
      `IOException`

  - ### fromJson

    public static PACurveMakerIO.Result fromJson(processing.data.JSONObject root)

  - ### pointsToJson

    private static processing.data.JSONArray pointsToJson(List<processing.core.PVector> points)

  - ### jsonToPoints

    private static ArrayList<processing.core.PVector> jsonToPoints(processing.data.JSONArray arr)

  - ### intsToJson

    private static processing.data.JSONArray intsToJson(int[] values)

  - ### jsonToIntsList

    private static ArrayList<Integer> jsonToIntsList(processing.data.JSONArray arr)

  - ### requireHeader

    private static void requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion)

  - ### putIfPresent

    private static void putIfPresent(processing.data.JSONObject obj, String key, String value)

  - ### nonNull

    private static String nonNull(String value, String fallback)