Package org.cytoscape.filter
Interface TransformerManager
-
public interface TransformerManagerA class for creating and executing Transformers.Module:
filter-apiTo use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>filter-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <C,E>
CompositeFilter<C,E>createCompositeFilter(Class<C> contextType, Class<E> elementType)Returns a new emptyCompositeFilterthat selects elements of typeelementTypefrom an object of typecontextType.<C,E>
NamedTransformer<C,E>createNamedTransformer(String name, List<Transformer<C,E>> transformers)Returns a newNamedTransformerwith the given name and list of transformers.<C,E>
Transformer<C,E>createTransformer(String id)Returns a new Transformer with the givenid.<C,E>
voidexecute(C context, List<Transformer<C,E>> transformers, TransformerSink<E> sink)Applies the given chain oftransformersto thecontext.<C,E>
voidexecute(C context, Transformer<C,E> transformer, TransformerSink<E> sink)Appliestransformerto thecontext.<C,E>
voidexecute(C context, TransformerSource<C,E> source, List<Transformer<C,E>> transformers, TransformerSink<E> sink)Applies the given chain oftransformersto thecontext, viasource.<C,E>
TransformerSource<C,E>getTransformerSource(Class<C> contextType)Returns aTransformerSourcefor the given contextType.
-
-
-
Method Detail
-
createCompositeFilter
<C,E> CompositeFilter<C,E> createCompositeFilter(Class<C> contextType, Class<E> elementType)
Returns a new emptyCompositeFilterthat selects elements of typeelementTypefrom an object of typecontextType.- Parameters:
contextType- The type of the context this filter selects from.elementType- The type of the elements this filter selects.- Returns:
- a new empty
CompositeFilter.
-
getTransformerSource
<C,E> TransformerSource<C,E> getTransformerSource(Class<C> contextType)
Returns aTransformerSourcefor the given contextType.- Parameters:
contextType- The type of the context object the TransformerSource should produce an element stream for.- Returns:
- a TransformerSource for the given context object type.
-
createTransformer
<C,E> Transformer<C,E> createTransformer(String id)
Returns a new Transformer with the givenid. SeeTransformersfor a list of the ids of the transformers that are part of the Cytoscape core.- Parameters:
id- the unique id of the type of Transformer to create.- Returns:
- a new Transformer with the given
id.
-
createNamedTransformer
<C,E> NamedTransformer<C,E> createNamedTransformer(String name, List<Transformer<C,E>> transformers)
Returns a newNamedTransformerwith the given name and list of transformers.- Parameters:
name- The name of the new transformer.transformers- The list of transformers that will be contained in the new NamedTransformer.
-
execute
<C,E> void execute(C context, Transformer<C,E> transformer, TransformerSink<E> sink)Appliestransformerto thecontext. The results of the transformation are collected bysink.- Parameters:
context- the object whose elements should be transformed.transformer- theTransformerthat should be applied.sink- collects the results of the transformation.
-
execute
<C,E> void execute(C context, List<Transformer<C,E>> transformers, TransformerSink<E> sink)Applies the given chain oftransformersto thecontext. The results of the transformation are collected bysink.- Parameters:
context- the object whose elements should be transformed.transformers- theTransformers that should be applied.sink- collects the results of the transformation.
-
execute
<C,E> void execute(C context, TransformerSource<C,E> source, List<Transformer<C,E>> transformers, TransformerSink<E> sink)Applies the given chain oftransformersto thecontext, viasource. Thesourcedetermines which elements are passed to thetransformers. The results of the transformation are collected bysink.- Parameters:
context- the object whose elements should be transformed.source- determines which elements are taken from the context.transformers- theTransformers that should be applied.sink- collects the results of the transformation.
-
-