libSBML Python API  5.18.0
libsbml.ElementFilter Class Reference
Inheritance diagram for libsbml.ElementFilter:
[legend]

Detailed Description

Base class for filter functions.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.

Some libSBML objects provide the ability to return lists of components. To provide callers with greater control over exactly what is returned, these methods take optional arguments in the form of filters. The ElementFilter class is the parent class for these filters.

Public Member Functions

def __init__ (self)
 Creates a new ElementFilter object. More...
 
def filter (self, element)
 Predicate to test elements. More...
 

Constructor & Destructor Documentation

def libsbml.ElementFilter.__init__ (   self)

Creates a new ElementFilter object.

__init__()   ElementFilter
 

Member Function Documentation

def libsbml.ElementFilter.filter (   self,
  element 
)

Predicate to test elements.

filter(SBase element)   bool

This is the central predicate of the ElementFilter class. In subclasses of ElementFilter, callers should implement this method such that it returns True for element arguments that are 'desirable' and False for those that are 'undesirable' in whatever filtering context the ElementFilter subclass is designed to be used.

Parameters
elementthe element to be tested.
Returns
True if the element is desirable or should be kept, False otherwise.