org.eclipse.january.metadata

## Interface IMetadata

- All Superinterfaces:
    Cloneable, IDataAnalysisObject, MetadataType, Serializable
  All Known Subinterfaces:
    IExtendedMetadata
  All Known Implementing Classes:
    Metadata

      public interface IMetadata
      extends IDataAnalysisObject, MetadataType, Serializable

  This interface describes the minimal metadata information that should be associated with a Dataset or DataHolder. It is intended that this interface will be implemented in an object that will then be associated with a DataHolder or dataset using setMetadata(IMetadata).

  All returned collections and maps are unmodifiable.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `serialVersionUID` Update this when there are any serious changes to API

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataInfo(String n, 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()`
    `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 filename)`
    `void` | `setMetadata(Map<String,? extends Serializable> map)` Set metadata map

- - ### Field Detail

    - #### serialVersionUID

          static final long serialVersionUID

      Update this when there are any serious changes to API
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### initialize

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

      Initialize metadata
      Parameters:
        `metadata` -

    - #### getFilePath

          String getFilePath()

      Returns:
        the path to the original file, or null if there was not a file.

    - #### getDataNames

          Collection<String> getDataNames()

      Returns a collection of dataset names or null if not implemented
      Returns:
        collection

    - #### getDataSizes

          Map<String,Integer> getDataSizes()

      Can be implemented to return sizes of datasets (size can be null if it is not known)
      Returns:
        map of sizes

    - #### getDataShapes

          Map<String,int[]> getDataShapes()

      Can be implemented to return shapes of dataset (shape can be null if it is not known)
      Returns:
        map of shapes

    - #### getMetaValue

          Serializable getMetaValue(String key)
                                    throws MetadataException

      Returns string value or null if not implemented
      Parameters:
        `key` -
      Returns:
        value
      Throws:
        `MetadataException`

    - #### getMetaNames

          Collection<String> getMetaNames()
                                          throws MetadataException

      Returns a collection of metadata names
      Returns:
        collection
      Throws:
        `MetadataException`

    - #### getUserObjects

          Collection<Serializable> getUserObjects()

      May be implemented to provide custom metadata in the form of a collection of serializable objects
      Returns:
        collection

    - #### clone

          IMetadata clone()

      Copy of metadata
      Specified by:
        `clone` in interface `IDataAnalysisObject`
      Specified by:
        `clone` in interface `MetadataType`
      Returns:
        deep copy

    - #### setFilePath

          void setFilePath(String filename)

    - #### addDataInfo

          void addDataInfo(String n,
                         int... shape)

      Add name and shape of a dataset to metadata
      Parameters:
        `name` -
        `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.)

    - #### addNames

          void addNames(Collection<String> names)

    - #### setMetadata

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

      Set metadata map
      Parameters:
        `metadata` -

Copyright © 2014–2018 Eclipse Foundation. All rights reserved.