net.sf.basedb.util.biomaterial
Class ExtractToSampleTransformer
java.lang.Object
net.sf.basedb.util.biomaterial.ExtractToSampleTransformer
- All Implemented Interfaces:
- CollectionTransformer<Extract,Sample>
public class ExtractToSampleTransformer
- extends Object
- implements CollectionTransformer<Extract,Sample>
Collection transformer that given a collection of extracts finds
their parent samples. Note that this transformer is only capable
of finding the samples that are immediate
parents to the extract. If you want to follow pooled extracts up
to samples, 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) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dc
private DbControl dc
ExtractToSampleTransformer
public ExtractToSampleTransformer(DbControl dc)
transform
public int transform(Collection<? extends Extract> extracts,
Collection<? super Sample> samples)
- Add all samples that are parents to any of the extracts in the
source collection.
- Specified by:
transform
in interface CollectionTransformer<Extract,Sample>
- Parameters:
extracts
- The source collectionsamples
- The destination collection
- Returns:
- The number of samples added
createQuery
protected ItemQuery<Sample> createQuery()
- Create a query for loading samples. The default implemenation will
simply load all samples. The restriction needed to locate the child
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