Class ClassFilter

  • All Implemented Interfaces:
    Filter, Serializable

    public class ClassFilter
    extends Base
    implements Filter
    Filter which discards all objects that are not of a certain class.
    Author:
    cp 1999.08.26
    See Also:
    Serialized Form
    • Constructor Detail

      • ClassFilter

        public ClassFilter​(Class clz)
        Constructor.
        Parameters:
        clz - the class
    • Method Detail

      • evaluate

        public boolean evaluate​(Object o)
        Filter interface: evaluate().
        Specified by:
        evaluate in interface Filter
        Parameters:
        o - the input argument to evaluate
        Returns:
        true if the input argument matches the filter, otherwise false
      • equals

        public boolean equals​(Object o)
        Compare the ClassFilter with another object to determine equality.
        Overrides:
        equals in class Object
        Returns:
        true iff this ClassFilter and the passed object are equivalent ClassFilters
      • hashCode

        public int hashCode()
        Determine a hash value for the ClassFilter object according to the general Object.hashCode() contract.
        Overrides:
        hashCode in class Object
        Returns:
        an integer hash value for this ClassFilter object
      • toString

        public String toString()
        Return a human-readable description for this Filter.
        Overrides:
        toString in class Object
        Returns:
        a String description of the Filter