net.sf.basedb.util.biomaterial
Class ExtractToLabeledExtractTransformer
java.lang.Object
net.sf.basedb.util.biomaterial.ExtractToLabeledExtractTransformer
- All Implemented Interfaces:
- CollectionTransformer<Extract,LabeledExtract>
public class ExtractToLabeledExtractTransformer
- extends Object
- implements CollectionTransformer<Extract,LabeledExtract>
Collection transformer that given a collection of extracts finds
all labeled extracts that has the extracts as parents. Note that this
transformer is only capable of finding labeled extracts that are immediate
children to the extracts. If you want to include labeled extracts that are
children to pooled extracts, you should combine this transformer
with a PooledChildrenTransformer
with the help of a
MultiStepCollectionTransformer
.
- Version:
- 2.10
- Author:
- Nicklas
- Last modified
- $Date: 2009-01-13 09:20:26 +0100 (Tue, 13 Jan 2009) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dc
private final DbControl dc
ExtractToLabeledExtractTransformer
public ExtractToLabeledExtractTransformer(DbControl dc)
- Create a new Extract-to-labeled extract transformer.
- Parameters:
dc
- The DbControl to use for database access
transform
public int transform(Collection<? extends Extract> extracts,
Collection<? super LabeledExtract> labeledExtracts)
- Add all labeled extracts that are children to any of the extracts in the
source collection.
- Specified by:
transform
in interface CollectionTransformer<Extract,LabeledExtract>
- Parameters:
extracts
- The source collectionlabeledExtracts
- The destination collection
- Returns:
- The number of labeled extracts added
createQuery
protected ItemQuery<LabeledExtract> createQuery()
- Create a query for loading labeled extracts. The default implemenation will
simply load all labeled extracts. The restriction needed to locate the extracts
that are parents is automatically applied by the
transform
method. Subclasses may override this method to create an alternate query
(for example, with more filters).
- Returns:
- A query object