public class ListBasedDocumentDataAdapter extends EmptyAnnotatedDataAdapter<ConcreteJPhyloIOEvent> implements DocumentDataAdapter
DocumentDataAdapter
. Instances of this class contain a list
for each property (OTU lists, matrices and trees/networks), which can be filled by the application
with their according adapter instances.
If documents with many elements (e.g. many trees) shall be written, application developers may choose to overwrite the according iterator property and return an iterator that directly accesses their application business model for performance reasons. (Otherwise a large list would have to be stored in this instance, which probably is a copy of an according list in the application business model.)
Constructor and Description |
---|
ListBasedDocumentDataAdapter()
Creates a new instance of this class with empty array lists for all properties.
|
ListBasedDocumentDataAdapter(org.apache.commons.collections4.map.ListOrderedMap<java.lang.String,OTUListDataAdapter> otusMap,
java.util.List<MatrixDataAdapter> matrices,
java.util.List<TreeNetworkGroupDataAdapter> treeNetworkGroups)
Creates a new instance of this class using the specified lists.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MatrixDataAdapter> |
getMatrices() |
java.util.Iterator<MatrixDataAdapter> |
getMatrixIterator(ReadWriteParameterMap parameters)
Returns an iterator providing access to all matrices contained in the document
to be written.
|
OTUListDataAdapter |
getOTUList(ReadWriteParameterMap parameters,
java.lang.String id)
Returns the OTU list referenced by the specified ID.
|
long |
getOTUListCount(ReadWriteParameterMap parameters)
Returns the number of OTU lists provided by this document adapter.
|
java.util.Iterator<OTUListDataAdapter> |
getOTUListIterator(ReadWriteParameterMap parameters)
Returns an iterator providing access to all OTU lists contained in the document
to be written.
|
org.apache.commons.collections4.map.ListOrderedMap<java.lang.String,OTUListDataAdapter> |
getOTUListsMap() |
java.util.Iterator<TreeNetworkGroupDataAdapter> |
getTreeNetworkGroupIterator(ReadWriteParameterMap parameters)
Returns an iterator providing access to all trees and network groups contained in the
document to be written.
|
java.util.List<TreeNetworkGroupDataAdapter> |
getTreeNetworkGroups() |
writeMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeMetadata
public ListBasedDocumentDataAdapter(org.apache.commons.collections4.map.ListOrderedMap<java.lang.String,OTUListDataAdapter> otusMap, java.util.List<MatrixDataAdapter> matrices, java.util.List<TreeNetworkGroupDataAdapter> treeNetworkGroups)
null
is specified for a
list an empty array list will be created internally for this property.otuLists
- the ordered map of OTU lists to be used in this instance (or null
to create a new empty list)matrices
- the list of matrices to be used in this instance (or null
to create a new empty list)treeNetworkGroups
- the list of trees or networks to be used in this instance (or null
to create a
new empty list)public ListBasedDocumentDataAdapter()
Using this constructor is equivalent to calling #ListBasedDocumentDataAdapter(List, List, List)
with only null
arguments.
public org.apache.commons.collections4.map.ListOrderedMap<java.lang.String,OTUListDataAdapter> getOTUListsMap()
public java.util.List<MatrixDataAdapter> getMatrices()
public java.util.List<TreeNetworkGroupDataAdapter> getTreeNetworkGroups()
public java.util.Iterator<OTUListDataAdapter> getOTUListIterator(ReadWriteParameterMap parameters)
DocumentDataAdapter
getOTUListIterator
in interface DocumentDataAdapter
parameters
- the parameter map of the calling writer that provides context information for the data requestnull
.)public long getOTUListCount(ReadWriteParameterMap parameters)
DocumentDataAdapter
getOTUListCount
in interface DocumentDataAdapter
parameters
- the parameter map of the calling writer that provides context information for the data requestDocumentDataAdapter.getOTUListIterator(ReadWriteParameterMap)
public OTUListDataAdapter getOTUList(ReadWriteParameterMap parameters, java.lang.String id) throws java.lang.IllegalArgumentException
DocumentDataAdapter
getOTUList
in interface DocumentDataAdapter
parameters
- the parameter map of the calling writer that provides context information for the data requestid
- the ID of the OTU list to be returnedjava.lang.IllegalArgumentException
- if no OTU list with the specified ID is availablepublic java.util.Iterator<MatrixDataAdapter> getMatrixIterator(ReadWriteParameterMap parameters)
DocumentDataAdapter
getMatrixIterator
in interface DocumentDataAdapter
parameters
- the parameter map of the calling writer that provides context information for the data requestnull
.)public java.util.Iterator<TreeNetworkGroupDataAdapter> getTreeNetworkGroupIterator(ReadWriteParameterMap parameters)
DocumentDataAdapter
getTreeNetworkGroupIterator
in interface DocumentDataAdapter
parameters
- the parameter map of the calling writer that provides context information for the data requestnull
.)