org.eclipse.january.dataset

## Class DataEvent

- java.lang.Object
- - java.util.EventObject
  - - org.eclipse.january.dataset.DataEvent

- All Implemented Interfaces:
    Serializable

      public class DataEvent
      extends EventObject

  Event fired to diseminate information about a dataset changing. For instance if an image represents a live stream. This event is passed over web-sockets. To keep dependencies to a minimum and since it is really simple, we have added an encode and decode to JSON without the need for an API like jackson.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataEvent()`
    `DataEvent(String name, int[] shape)` Creates an event to notify that this data has changed.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DataEvent` | `decode(String json)` Decodes from String for instance {"name" : "Tests", "shape" : [1024, 1024], "filepath" : "C:/tmp/Fred.txt"}
    `String` | `encode()` Encodes event to string
    `boolean` | `equals(Object obj)`
    `String` | `getFilePath()`
    `String` | `getName()`
    `int[]` | `getShape()`
    `String` | `getSource()`
    `int` | `hashCode()`
    `void` | `setFilePath(String filePath)`
    `void` | `setName(String name)`
    `void` | `setShape(int[] shape)`

    - ### Methods inherited from class java.util.EventObject

      `toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DataEvent

          public DataEvent()

    - #### DataEvent

          public DataEvent(String name,
                   int[] shape)

      Creates an event to notify that this data has changed.
      Parameters:
        `name` -

  - ### Method Detail

    - #### getSource

          public String getSource()

      Overrides:
        `getSource` in class `EventObject`

    - #### getName

          public String getName()

    - #### setName

          public void setName(String name)

    - #### getShape

          public int[] getShape()

    - #### setShape

          public void setShape(int[] shape)

    - #### getFilePath

          public String getFilePath()

    - #### setFilePath

          public void setFilePath(String filePath)

    - #### encode

          public String encode()

      Encodes event to string
      Returns:
        encoded string

    - #### decode

          public static DataEvent decode(String json)

      Decodes from String for instance {"name" : "Tests", "shape" : [1024, 1024], "filepath" : "C:/tmp/Fred.txt"}
      Returns:
        DataEvent

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2017. All rights reserved.