2.17.2: 2011-06-17

net.sf.basedb.util.biomaterial
Class LabeledExtractToExtractTransformer

java.lang.Object
  extended by net.sf.basedb.util.biomaterial.LabeledExtractToExtractTransformer
All Implemented Interfaces:
CollectionTransformer<LabeledExtract,Extract>

public class LabeledExtractToExtractTransformer
extends Object
implements CollectionTransformer<LabeledExtract,Extract>

Collection transformer that given a collection of labeled extracts finds their parent extract. Note that this transformer is only capable of finding the extracts that are immediate parents to the labeled extract. If you want to follow pooled labeled extracts up to extracts, you should combine this transformer and a PooledParentsTransformer 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) $

Field Summary
private  DbControl dc
           
 
Constructor Summary
LabeledExtractToExtractTransformer(DbControl dc)
           
 
Method Summary
protected  ItemQuery<Extract> createQuery()
          Create a query for loading extracts.
 int transform(Collection<? extends LabeledExtract> labeledExtracts, Collection<? super Extract> extracts)
          Add all samples that are parents to any of the extracts in the source collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dc

private DbControl dc
Constructor Detail

LabeledExtractToExtractTransformer

public LabeledExtractToExtractTransformer(DbControl dc)
Method Detail

transform

public int transform(Collection<? extends LabeledExtract> labeledExtracts,
                     Collection<? super Extract> extracts)
Add all samples that are parents to any of the extracts in the source collection.

Specified by:
transform in interface CollectionTransformer<LabeledExtract,Extract>
Parameters:
labeledExtracts - The source collection
extracts - The destination collection
Returns:
The number of samples added

createQuery

protected ItemQuery<Extract> createQuery()
Create a query for loading extracts. The default implemenation will simply load all extracts. The restriction needed to locate the child labeled extracts 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

2.17.2: 2011-06-17