info.bioinfweb.jphyloio.dataadapters.implementations

## Class EmptyObjectListDataAdapter<E extends JPhyloIOEvent>

- java.lang.Object
- - info.bioinfweb.jphyloio.dataadapters.implementations.EmptyObjectListDataAdapter<E>

- All Implemented Interfaces:
    ObjectListDataAdapter<E>

      public class EmptyObjectListDataAdapter<E extends JPhyloIOEvent>
      extends java.lang.Object
      implements ObjectListDataAdapter<E>

  Empty implementation of `ObjectListDataAdapter`. Can be used by applications that do not model any of the according objects.
  Author:
    Ben Stöver

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static EmptyObjectListDataAdapter` | `SHARED_EMPTY_OBJECT_LIST_ADAPTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmptyObjectListDataAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCount(ReadWriteParameterMap parameters)` This default implementation always returns 0.
    `java.util.Iterator<java.lang.String>` | `getIDIterator(ReadWriteParameterMap parameters)` This default implementation always returns an empty iterator.
    `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)` Always throws an `IllegalArgumentException`, since this default implementation does not contain any objects.

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

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

- - ### Field Detail

    - #### SHARED_EMPTY_OBJECT_LIST_ADAPTER

          public static final EmptyObjectListDataAdapter SHARED_EMPTY_OBJECT_LIST_ADAPTER

  - ### Constructor Detail

    - #### EmptyObjectListDataAdapter

          public EmptyObjectListDataAdapter()

  - ### Method Detail

    - #### getObjectStartEvent

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

      Description copied from interface: `ObjectListDataAdapter`
      Returns the start event of an object determined by the specified object ID.
      Specified by:
        `getObjectStartEvent` in interface `ObjectListDataAdapter<E extends JPhyloIOEvent>`
      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

          public long getCount(ReadWriteParameterMap parameters)

      This default implementation always returns 0.
      Specified by:
        `getCount` in interface `ObjectListDataAdapter<E extends JPhyloIOEvent>`
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
      Returns:
        always 0
      See Also:
        `ObjectListDataAdapter.getCount(ReadWriteParameterMap)`

    - #### getIDIterator

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

      This default implementation always returns an empty iterator.
      Specified by:
        `getIDIterator` in interface `ObjectListDataAdapter<E extends JPhyloIOEvent>`
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
      Returns:
        always an empty iterator
      See Also:
        `ObjectListDataAdapter.getIDIterator(ReadWriteParameterMap)`

    - #### writeContentData

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

      Always throws an `IllegalArgumentException`, since this default implementation does not contain any objects.
      Specified by:
        `writeContentData` in interface `ObjectListDataAdapter<E extends JPhyloIOEvent>`
      Parameters:
        `parameters` - the parameter map of the calling writer that provides context information for the data request
        `receiver` - the receiver for the events
      Throws:
        `java.io.IOException` - if a I/O error occurs while writing the data
        `java.lang.IllegalArgumentException` - if an unknown ID was specified
      See Also:
        `ObjectListDataAdapter.writeContentData(ReadWriteParameterMap, info.bioinfweb.jphyloio.dataadapters.JPhyloIOEventReceiver, java.lang.String)`