Class CompoundFilter<T>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Filter<T>
    Direct Known Subclasses:
    AndFilter

    public abstract class CompoundFilter<T>
    extends java.lang.Object
    implements Filter<T>, java.lang.Cloneable, java.io.Serializable
    This filter provides a simple framework for combining the behavior of a pair of filters.
    Version:
    2.3
    See Also:
    Serialized Form
    Since:
    2.3
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CompoundFilter​(Filter<T> filter1, Filter<T> filter2)
      Creates a new CompoundFilter that will "accept" any object that is accept by both of the specified wrapped filters.
    • Field Detail

      • filter1

        protected final Filter<T> filter1
        The first Filter used to accept the value.
      • filter2

        protected final Filter<T> filter2
        The second Filter used to accept the value.
    • Constructor Detail

      • CompoundFilter

        protected CompoundFilter​(Filter<T> filter1,
                                 Filter<T> filter2)
        Creates a new CompoundFilter that will "accept" any object that is accept by both of the specified wrapped filters.
        Parameters:
        filter1 - The first Filter used to accept the value
        filter2 - The second Filter used to accept the value
    • Method Detail

      • clone

        public CompoundFilter<T> clone()
        Overrides:
        clone in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • getFilter1

        public Filter<T> getFilter1()
        Returns the left Filter of this compound filter.
        Returns:
        The first Filter
      • getFilter2

        public Filter<T> getFilter2()
        Returns the second Filter of this compound filter.
        Returns:
        The second Filter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • operatorString

        protected abstract java.lang.String operatorString()
        Returns a string representation of the filter's operator.
        Returns:
        The string value of the operator
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object