Class StringFieldFilter

java.lang.Object
org.biopax.paxtools.query.wrapperL3.Filter
org.biopax.paxtools.query.wrapperL3.StringFieldFilter
Direct Known Subclasses:
DataSourceFilter, OrganismFilter

public abstract class StringFieldFilter extends Filter
This is the base class for filters that are filtering based on values of specific fields of the objects and their related objects.
Author:
Ozgun Babur
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Option to accept objects if the field is empty or null.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    StringFieldFilter(boolean emptyOK, String[] valid)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addAccessor(PathAccessor acc, Class<? extends BioPAXElement> clazz)
    Adds the given PathAccessor to the list of accessors to use to get field values of objects and their related objects.
    protected void
    Adds the given valid value to the set of valid values.
    abstract void
    The child class should populate the list of PathAccessor object using the addAccessor method.
    boolean
    Gets the option to accept empty fields.
    boolean
    Checks if the related values of the object are among valid values.
    void
    setEmptyOK(boolean emptyOK)
    Sets the parameter to accept empty field values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • emptyOK

      protected boolean emptyOK
      Option to accept objects if the field is empty or null.
  • Constructor Details

    • StringFieldFilter

      protected StringFieldFilter(boolean emptyOK, String[] valid)
      Constructor.
      Parameters:
      emptyOK - whether to always accept empty field when traversing the graph or reject
      valid - filter values (strings' capitalization does not matter)
  • Method Details

    • isEmptyOK

      public boolean isEmptyOK()
      Gets the option to accept empty fields.
      Returns:
      true if empty is ok
    • setEmptyOK

      public void setEmptyOK(boolean emptyOK)
      Sets the parameter to accept empty field values.
      Parameters:
      emptyOK - parameter to accept empty filed
    • createFieldAccessors

      public abstract void createFieldAccessors()
      The child class should populate the list of PathAccessor object using the addAccessor method.
    • addAccessor

      protected void addAccessor(PathAccessor acc, Class<? extends BioPAXElement> clazz)
      Adds the given PathAccessor to the list of accessors to use to get field values of objects and their related objects.
      Parameters:
      acc - accessor
      clazz - the type of element that the accessor is applied
    • addValidValue

      protected void addValidValue(String value)
      Adds the given valid value to the set of valid values.
      Parameters:
      value - a valid value
    • okToTraverse

      public boolean okToTraverse(Level3Element ele)
      Checks if the related values of the object are among valid values. Returns true if none of the accessors is applicable to the given object.
      Specified by:
      okToTraverse in class Filter
      Parameters:
      ele - level 3 element to check
      Returns:
      true if ok to traverse