Package jadex.common

Class ComposedFilter<T>

java.lang.Object
jadex.common.ComposedFilter<T>
All Implemented Interfaces:
IFilter<T>, Serializable

public class ComposedFilter<T> extends Object implements IFilter<T>, Serializable
A filter checks if an object matches the given subfilters.
See Also:
  • Field Details

  • Constructor Details

    • ComposedFilter

      public ComposedFilter()
      Create a composed filter.
      Parameters:
      filters - The filters.
      operator - The operator.
    • ComposedFilter

      public ComposedFilter(IFilter<T>... filters)
      Create a composed filter.
      Parameters:
      filters - The filters.
      operator - The operator.
    • ComposedFilter

      public ComposedFilter(IFilter<T>[] filters, int operator)
      Create a composed filter.
      Parameters:
      filters - The filters.
      operator - The operator.
  • Method Details

    • filter

      public boolean filter(T object)
      Match an object against the filter.
      Specified by:
      filter in interface IFilter<T>
      Parameters:
      object - The object.
      Returns:
      True, if the filter matches.
      Throws:
      Exception
    • getFilters

      public IFilter<T>[] getFilters()
      Get the filters.
      Returns:
      the filters.
    • setFilters

      public void setFilters(IFilter<T>[] filters)
      Set the filters.
      Parameters:
      filters - The filters to set.
    • addFilter

      public void addFilter(IFilter<T> filter)
      Add a filter.
      Parameters:
      filter - The filter.
    • getOperator

      public int getOperator()
      Get the operator.
      Returns:
      the operator.
    • setOperator

      public void setOperator(int operator)
      Set the operator.
      Parameters:
      operator - The operator to set.
    • hashCode

      public int hashCode()
      Get the hashcode.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Test if an object is equal to this.
      Overrides:
      equals in class Object
    • operatorToString

      public static String operatorToString(int operator)
      Create a string representation of the operator.
      Returns:
      A string representing the operator.
    • toString

      public String toString()
      Create a string representation of this filter.
      Overrides:
      toString in class Object
      Returns:
      A string representing this filter.