Package org.cytoscape.filter.model
Interface Filter<C,E>
-
- Type Parameters:
C
- The context type of the elements thisFilter
operates on.E
- The element type thisFilter
operates on.
- All Superinterfaces:
Transformer<C,E>
- All Known Subinterfaces:
CompositeFilter<C,E>
public interface Filter<C,E> extends Transformer<C,E>
A transformer that decides whether to accept or reject elements. To make a customFilter
available in Cytoscape, create anFilterFactory
that constructs the customFilter
, and register the factory as an OSGi service. To make the transformer show up in the UI, create aTransformerViewFactory
and register it as an OSGi service. TheFilter
,FilterFactory
andTransformerViewFactory
need to have the same id.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 (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
accepts(C context, E element)
Returnstrue
if this filter accepts the given element fromcontext
.default boolean
isAlwaysFalse()
Returns true if the accepts() method will always return false for all inputs.-
Methods inherited from interface org.cytoscape.filter.model.Transformer
addListener, getContextType, getElementType, getId, getName, removeListener
-
-
-
-
Method Detail
-
accepts
boolean accepts(C context, E element)
Returnstrue
if this filter accepts the given element fromcontext
.- Parameters:
context
- the context object of the transformed element.element
- the element to transform.- Returns:
true
if this filter accepts the given element.
-
isAlwaysFalse
default boolean isAlwaysFalse()
Returns true if the accepts() method will always return false for all inputs. This is an optimization to avoid running the filter if its just going to fail on all input anyway. This typically happens when the filter is not fully configured, for example a column filter might still be displaying "choose column".
-
-