Package org.cytoscape.filter
Interface TransformerManager
-
public interface TransformerManager
A class for creating and executing Transformers.Module:
filter-api
To 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 emptyCompositeFilter
that selects elements of typeelementType
from an object of typecontextType
.<C,E>
NamedTransformer<C,E>createNamedTransformer(String name, List<Transformer<C,E>> transformers)
Returns a newNamedTransformer
with 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 oftransformers
to thecontext
.<C,E>
voidexecute(C context, Transformer<C,E> transformer, TransformerSink<E> sink)
Appliestransformer
to thecontext
.<C,E>
voidexecute(C context, TransformerSource<C,E> source, List<Transformer<C,E>> transformers, TransformerSink<E> sink)
Applies the given chain oftransformers
to thecontext
, viasource
.<C,E>
TransformerSource<C,E>getTransformerSource(Class<C> contextType)
Returns aTransformerSource
for the given contextType.
-
-
-
Method Detail
-
createCompositeFilter
<C,E> CompositeFilter<C,E> createCompositeFilter(Class<C> contextType, Class<E> elementType)
Returns a new emptyCompositeFilter
that selects elements of typeelementType
from 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 aTransformerSource
for 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
. SeeTransformers
for 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 newNamedTransformer
with 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)
Appliestransformer
to thecontext
. The results of the transformation are collected bysink
.- Parameters:
context
- the object whose elements should be transformed.transformer
- theTransformer
that 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 oftransformers
to thecontext
. The results of the transformation are collected bysink
.- Parameters:
context
- the object whose elements should be transformed.transformers
- theTransformer
s 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 oftransformers
to thecontext
, viasource
. Thesource
determines 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
- theTransformer
s that should be applied.sink
- collects the results of the transformation.
-
-