org.eclipse.january.metadata

## Class Metadata

- java.lang.Object
- - org.eclipse.january.metadata.Metadata

- All Implemented Interfaces:
    Serializable, Cloneable, IDataAnalysisObject, IMetadata, MetadataType

      public class Metadata
      extends Object
      implements IMetadata

  Basic implementation of metadata
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Metadata()`
    `Metadata(Map<String,? extends Serializable> metadata)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataInfo(String name, int... shape)` Add name and shape of a dataset to metadata
    `void` | `addNames(Collection<String> names)`
    `IMetadata` | `clone()` Copy of metadata
    `Collection<String>` | `getDataNames()` Returns a collection of dataset names or null if not implemented
    `Map<String,int[]>` | `getDataShapes()` Can be implemented to return shapes of dataset (shape can be null if it is not known)
    `Map<String,Integer>` | `getDataSizes()` Can be implemented to return sizes of datasets (size can be null if it is not known)
    `String` | `getFilePath()`
    `protected Map<String,? extends Serializable>` | `getInternalMetadata()` Internal use only
    `Collection<String>` | `getMetaNames()` Returns a collection of metadata names
    `Serializable` | `getMetaValue(String key)` Returns string value or null if not implemented
    `Collection<Serializable>` | `getUserObjects()` May be implemented to provide custom metadata in the form of a collection of serializable objects
    `void` | `initialize(Map<String,? extends Serializable> metadata)` Initialize metadata
    `void` | `setFilePath(String filePath)`
    `void` | `setMetadata(Map<String,? extends Serializable> metadata)` Set metadata map
    `void` | `setUserObjects(Collection<Serializable> objects)` Set user objects

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

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

- - ### Constructor Detail

    - #### Metadata

          public Metadata()

    - #### Metadata

          public Metadata(Map<String,? extends Serializable> metadata)

  - ### Method Detail

    - #### initialize

          public void initialize(Map<String,? extends Serializable> metadata)

      Description copied from interface: `IMetadata`
      Initialize metadata
      Specified by:
        `initialize` in interface `IMetadata`

    - #### addNames

          public void addNames(Collection<String> names)

      Specified by:
        `addNames` in interface `IMetadata`

    - #### setMetadata

          public void setMetadata(Map<String,? extends Serializable> metadata)

      Set metadata map
      Specified by:
        `setMetadata` in interface `IMetadata`
      Parameters:
        `metadata` -

    - #### getInternalMetadata

          protected Map<String,? extends Serializable> getInternalMetadata()

      Internal use only
      Returns:
        metadata map

    - #### setUserObjects

          public void setUserObjects(Collection<Serializable> objects)

      Set user objects
      Parameters:
        `objects` -

    - #### addDataInfo

          public void addDataInfo(String name,
                         int... shape)

      Description copied from interface: `IMetadata`
      Add name and shape of a dataset to metadata
      Specified by:
        `addDataInfo` in interface `IMetadata`
        `shape` - (can be null or zero-length) (NOTE method should be public, people can define loaders outside this package like the DESY FIO loader for instance.)

    - #### getDataNames

          public Collection<String> getDataNames()

      Description copied from interface: `IMetadata`
      Returns a collection of dataset names or null if not implemented
      Specified by:
        `getDataNames` in interface `IMetadata`
      Returns:
        collection

    - #### getDataShapes

          public Map<String,int[]> getDataShapes()

      Description copied from interface: `IMetadata`
      Can be implemented to return shapes of dataset (shape can be null if it is not known)
      Specified by:
        `getDataShapes` in interface `IMetadata`
      Returns:
        map of shapes

    - #### getDataSizes

          public Map<String,Integer> getDataSizes()

      Description copied from interface: `IMetadata`
      Can be implemented to return sizes of datasets (size can be null if it is not known)
      Specified by:
        `getDataSizes` in interface `IMetadata`
      Returns:
        map of sizes

    - #### getMetaValue

          public Serializable getMetaValue(String key)
                                    throws MetadataException

      Description copied from interface: `IMetadata`
      Returns string value or null if not implemented
      Specified by:
        `getMetaValue` in interface `IMetadata`
      Returns:
        value
      Throws:
        `MetadataException`

    - #### getMetaNames

          public Collection<String> getMetaNames()
                                          throws MetadataException

      Description copied from interface: `IMetadata`
      Returns a collection of metadata names
      Specified by:
        `getMetaNames` in interface `IMetadata`
      Returns:
        collection
      Throws:
        `MetadataException`

    - #### getUserObjects

          public Collection<Serializable> getUserObjects()

      Description copied from interface: `IMetadata`
      May be implemented to provide custom metadata in the form of a collection of serializable objects
      Specified by:
        `getUserObjects` in interface `IMetadata`
      Returns:
        collection

    - #### clone

          public IMetadata clone()

      Description copied from interface: `IMetadata`
      Copy of metadata
      Specified by:
        `clone` in interface `IDataAnalysisObject`
      Specified by:
        `clone` in interface `IMetadata`
      Specified by:
        `clone` in interface `MetadataType`
      Overrides:
        `clone` in class `Object`
      Returns:
        deep copy

    - #### getFilePath

          public String getFilePath()

      Specified by:
        `getFilePath` in interface `IMetadata`
      Returns:
        the path to the original file, or null if there was not a file.

    - #### setFilePath

          public void setFilePath(String filePath)

      Specified by:
        `setFilePath` in interface `IMetadata`

Copyright © 2017. All rights reserved.