Package org.ka2ddo.yaac.filter
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
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
FieldsModifier and TypeFieldDescriptionstatic 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 -
Method Summary
Modifier and TypeMethodDescriptionabstract 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()).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()).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.clone()
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.
-
Field Details
-
RESULT_REJECT
public static final int RESULT_REJECTThe 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_REJECTThe 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_NEUTRALThis Filter cannot determine if this object passes the filter or not.- See Also:
-
RESULT_WEAK_PASS
public static final int RESULT_WEAK_PASSThe object is loosely acceptable to the Filter.- See Also:
-
RESULT_PASS
public static final int RESULT_PASSThe object exactly passes this Filter and is completely acceptable by the Filter's constraints.- See Also:
-
-
Constructor Details
-
Filter
public Filter()
-
-
Method Details
-
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
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
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
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
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
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
Register a listener for changes of this Filter.- Parameters:
l
- FilterChangeListener to register
-
removeFilterChangeListener
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
Creates and returns a copy of this object.- Overrides:
clone
in classObject
- Returns:
- a clone of this instance.
- Throws:
CloneNotSupportedException
- if the object's class does not support theCloneable
interface. Subclasses that override theclone
method can also throw this exception to indicate that an instance cannot be cloned. Valid Filters should never throw this exception.- See Also:
-