info.bioinfweb.jphyloio.dataadapters

## Interface ObjectListDataAdapter<E extends JPhyloIOEvent>

- Type Parameters:
    `E` - the event type of start events representing elements of this list
  All Known Subinterfaces:
    OTUListDataAdapter
  All Known Implementing Classes:
    EmptyObjectListDataAdapter, StoreObjectListDataAdapter, StoreOTUListDataAdapter, UndefinedOTUListDataAdapter

      public interface ObjectListDataAdapter<E extends JPhyloIOEvent>

  Allows to provide data for a list of phylogenetic objects. All objects need to be identified by unique IDs, provided by `getIDIterator(ReadWriteParameterMap)`. The start event of each object will be requested by separate calls of `getObjectStartEvent(ReadWriteParameterMap, String)` and the event sequence by separate calls of `writeContentData(ReadWriteParameterMap, JPhyloIOEventReceiver, String)`.

  Such objects may e.g. be OTUs, token sets or character sets, depending on where instances of this interface are used.

  Applications implementing this adapter may consider to inherit their implementation from `EmptyAnnotatedDataAdapter`. `EmptyObjectListDataAdapter` allows to directly define an empty list.

  Author:
    Ben Stöver

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCount(ReadWriteParameterMap parameters)` Returns the number of objects to be returned by `getIDIterator(ReadWriteParameterMap)`.
    `java.util.Iterator<java.lang.String>` | `getIDIterator(ReadWriteParameterMap parameters)` Returns an iterator returning the IDs of all objects contained in the list modeled by this instance.
    `E` | `getObjectStartEvent(ReadWriteParameterMap parameters, java.lang.String id)` Returns the start event of an object determined by the specified object ID.
    `void` | `writeContentData(ReadWriteParameterMap parameters, JPhyloIOEventReceiver receiver, java.lang.String id)` Writes the nested events in the specified object describing its contents.

- - ### Method Detail

    - #### getObjectStartEvent

          E getObjectStartEvent(ReadWriteParameterMap parameters,
                                java.lang.String id)
                         throws java.lang.IllegalArgumentException

      Returns the start event of an object determined by the specified object ID.
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
        `id` - the ID of the requested object
      Returns:
        an instance of a labeled ID event that describes the specified object
      Throws:
        `java.lang.IllegalArgumentException` - if no to object for the specified ID is present

    - #### getCount

          long getCount(ReadWriteParameterMap parameters)

      Returns the number of objects to be returned by `getIDIterator(ReadWriteParameterMap)`.
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
      Returns:
        the number of objects in the list modeled by this instance

    - #### getIDIterator

          java.util.Iterator<java.lang.String> getIDIterator(ReadWriteParameterMap parameters)

      Returns an iterator returning the IDs of all objects contained in the list modeled by this instance.
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
      Returns:
        an iterator returning the IDs (Depending in the usage of this object, the returned iterator must return at least one element or can be empty, but it may never be `null`.)

    - #### writeContentData

          void writeContentData(ReadWriteParameterMap parameters,
                                JPhyloIOEventReceiver receiver,
                                java.lang.String id)
                         throws java.io.IOException,
                                java.lang.IllegalArgumentException

      Writes the nested events in the specified object describing its contents.
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
        `receiver` - the receiver for the events
        `nodeID` - the ID of the requested node
      Throws:
        `java.io.IOException` - if a I/O error occurs while writing the data
        `java.lang.IllegalArgumentException` - if an unknown ID was specified