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 Detail

      • createCompositeFilter

        <C,​E> CompositeFilter<C,​E> createCompositeFilter​(Class<C> contextType,
                                                                     Class<E> elementType)
        Returns a new empty CompositeFilter that selects elements of type elementType from an object of type contextType.
        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 a TransformerSource 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 given id. See Transformers 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 new NamedTransformer 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)
        Applies transformer to the context. The results of the transformation are collected by sink.
        Parameters:
        context - the object whose elements should be transformed.
        transformer - the Transformer 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 of transformers to the context. The results of the transformation are collected by sink.
        Parameters:
        context - the object whose elements should be transformed.
        transformers - the Transformers 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 of transformers to the context, via source. The source determines which elements are passed to the transformers. The results of the transformation are collected by sink.
        Parameters:
        context - the object whose elements should be transformed.
        source - determines which elements are taken from the context.
        transformers - the Transformers that should be applied.
        sink - collects the results of the transformation.