Class Filter

java.lang.Object
org.ka2ddo.yaac.filter.Filter
Direct Known Subclasses:
AddresseeFilter, AreaFilter, CumulativeBooleanAndFilter, CumulativeBooleanOrFilter, DestinationFilter, EntryFilter, FirstDigipeatFilter, FromFilter, LastDigipeatFilter, LocalStationFilter, MessageContentFilter, MicEFilter, NotFilter, ObjectNameFilter, OperatorPresentFilter, PacketSourceFilter, PacketTypeFilter, PlaybackFilter, PriorityFilter, RadiusFilter, RelativeTimeFilter, SendingStationFilter, StationClassFilter, SymbolFilter, ToFilter, ValidInvalidFilter

public abstract class Filter extends Object
This abstract class defines the basic concept of a message filter. It defines APIs by which an arbitrarily complex filter expression may be used to specify which messages and stations are displayed.

Note this abstract class does not extend the Cloneable interface, to ensure that Filter subclass implementers explicitly ensure that the clone() method has been properly adjusted to correctly clone the stateful Filters.

Author:
Andrew Pavlin, KA2DDO
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    This Filter cannot determine if this object passes the filter or not.
    static final int
    The object exactly passes this Filter and is completely acceptable by the Filter's constraints.
    static final int
    The object is completely unacceptable to this Filter and should not be displayed, saved, etc..
    static final int
    The object is loosely acceptable to the Filter.
    static final int
    The object is unacceptable to the Filter, but might want to be kept around and indicated as unacceptable.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a Filter instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Indicate whether the specified message should be displayed or used to determine if a station should be displayed (if recursively called from acceptStation()).
    abstract int
    Indicate whether the specified message should be displayed or used to determine if a station should be displayed (if recursively called from acceptStation()).
    abstract int
    Indicate whether the specified station should be displayed.
    abstract void
    Register a listener for changes of this Filter.
    boolean
    Specifies that this filter may reject some stations, messages, and/or frames.
    Creates and returns a copy of this object.
    abstract String
    Report a tag name used to look up JavaHelp for a filter editor.
    abstract String
    Report a tag name used to look up the labelling for an editor panel for this editor instance in a ResourceBundle of translated names.
    abstract String
    Get the class name of a dynamically loadable class for the the GUI for this filter.
    abstract void
    Deregisters a listener.
    abstract void
    Reset the filter to a configuration that would pass the maximum amount of messages, packets, and stations.

    Methods inherited from class java.lang.Object

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

    • RESULT_REJECT

      public static final int RESULT_REJECT
      The object is completely unacceptable to this Filter and should not be displayed, saved, etc..
      See Also:
    • RESULT_WEAK_REJECT

      public static final int RESULT_WEAK_REJECT
      The object is unacceptable to the Filter, but might want to be kept around and indicated as unacceptable.
      See Also:
    • RESULT_NEUTRAL

      public static final int RESULT_NEUTRAL
      This Filter cannot determine if this object passes the filter or not.
      See Also:
    • RESULT_WEAK_PASS

      public static final int RESULT_WEAK_PASS
      The object is loosely acceptable to the Filter.
      See Also:
    • RESULT_PASS

      public static final int RESULT_PASS
      The object exactly passes this Filter and is completely acceptable by the Filter's constraints.
      See Also:
  • Constructor Details

    • Filter

      protected Filter()
      Create a Filter instance.
  • Method Details

    • getFilterTypeTagName

      public abstract String getFilterTypeTagName()
      Report a tag name used to look up the labelling for an editor panel for this editor instance in a ResourceBundle of translated names.
      Returns:
      String to use in looking up form label for this filter's editor
    • getFilterHelpTagName

      public abstract String getFilterHelpTagName()
      Report a tag name used to look up JavaHelp for a filter editor.
      Returns:
      String name (as defined in HelpMap.jhm) for this filter's online help, or null if there is no filter specific help
    • getFilterUIName

      public abstract String getFilterUIName()
      Get the class name of a dynamically loadable class for the the GUI for this filter. The name is allowed to have a wildcard '*' in it where a GUI type ("gui" for standard Java or "android" for Android) can be substituted.
      Returns:
      String name of GUI class for this filter
    • acceptStation

      public abstract int acceptStation(StationState ss)
      Indicate whether the specified station should be displayed. The acceptMessage() and acceptAX25Frame() methods may be called to assist in the determination.
      Parameters:
      ss - StationState record to analyze
      Returns:
      RESULT_xxx constant indicating if station information should be displayed
    • acceptMessage

      public abstract int acceptMessage(AX25Message msg)
      Indicate whether the specified message should be displayed or used to determine if a station should be displayed (if recursively called from acceptStation()).
      Parameters:
      msg - the APRS Message record to analyze
      Returns:
      RESULT_xxx constant indicating if message information should be displayed
    • acceptAX25Frame

      public abstract int acceptAX25Frame(AX25Frame frame)
      Indicate whether the specified message should be displayed or used to determine if a station should be displayed (if recursively called from acceptStation()).
      Parameters:
      frame - the timestamped AX25 frame record to analyze
      Returns:
      RESULT_xxx constant indicating if message information should be displayed
    • addFilterChangeListener

      public abstract void addFilterChangeListener(FilterChangeListener l)
      Register a listener for changes of this Filter.
      Parameters:
      l - FilterChangeListener to register
    • removeFilterChangeListener

      public abstract void removeFilterChangeListener(FilterChangeListener l)
      Deregisters a listener. The listener will no longer be informed of changes to this filter.
      Parameters:
      l - FilterChangeListener to deregister
    • setToPassall

      public abstract void setToPassall()
      Reset the filter to a configuration that would pass the maximum amount of messages, packets, and stations.
    • canRejectSome

      public boolean canRejectSome()
      Specifies that this filter may reject some stations, messages, and/or frames. Used to tell combining filters whether a sub-filter is in passall mode and therefore doesn't need to be checked for every call to the combiner, thereby saving filtering CPU time when most filters are in passall mode. Expected to be overridden by concrete subclasses that have a passall capability; the default implementation always indicates the filter can potentially reject some frames, messages, and stations.
      Returns:
      boolean true if this filter is currently capable of rejecting something
      See Also:
    • clone

      public Object clone() throws CloneNotSupportedException
      Creates and returns a copy of this object.
      Overrides:
      clone in class Object
      Returns:
      a clone of this instance.
      Throws:
      CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. Valid Filters should never throw this exception.
      See Also: