org.expasy.jpl.commons.base.process
Class SequenceTransformer<T>

java.lang.Object
  extended by org.expasy.jpl.commons.base.process.SequenceTransformer<T>
All Implemented Interfaces:
org.apache.commons.collections15.Transformer<T,T>

public final class SequenceTransformer<T>
extends Object
implements org.apache.commons.collections15.Transformer<T,T>

Manager that handles list of Transformer<T> and transform all.

Author:
mueller, nikitin

Field Summary
protected  List<org.apache.commons.collections15.Transformer<T,T>> transformers
          the list of object processors
 
Method Summary
 void add(org.apache.commons.collections15.Transformer<T,T> transformer)
          Add a transformer.
 void addAll(List<org.apache.commons.collections15.Transformer<T,T>> transformers)
          Add a list of transformers.
 void clear()
          Remove all transformers.
 List<org.apache.commons.collections15.Transformer<T,T>> getTransformers()
          Get object processors.
static
<T> SequenceTransformer<T>
newInstance()
           
 void setTransformers(List<org.apache.commons.collections15.Transformer<T,T>> transformers)
          Set processors.
 int size()
           
 T transform(T object)
          Successively process object by all processors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformers

protected List<org.apache.commons.collections15.Transformer<T,T>> transformers
the list of object processors

Method Detail

newInstance

public static <T> SequenceTransformer<T> newInstance()

getTransformers

public List<org.apache.commons.collections15.Transformer<T,T>> getTransformers()
Get object processors.

Returns:
list of processors.

size

public int size()
Returns:
the number of transformer in the sequence.

setTransformers

public void setTransformers(List<org.apache.commons.collections15.Transformer<T,T>> transformers)
Set processors.

Parameters:
processors - list of processors.

add

public void add(org.apache.commons.collections15.Transformer<T,T> transformer)
Add a transformer.

Parameters:
transformer - transformer to add.

addAll

public void addAll(List<org.apache.commons.collections15.Transformer<T,T>> transformers)
Add a list of transformers.

Parameters:
transformers - processors to add.

clear

public void clear()
Remove all transformers.


transform

public T transform(T object)
Successively process object by all processors.

Specified by:
transform in interface org.apache.commons.collections15.Transformer<T,T>
Parameters:
object - object to be processed.
Returns:
the object after been processed.


Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.