Package adams.data.filter
Class AbstractGlobalDataContainerFilter<T extends DataContainer>
- java.lang.Object
-
- adams.data.filter.AbstractGlobalDataContainerFilter<T>
-
- Type Parameters:
T
- the type of container to filter
public abstract class AbstractGlobalDataContainerFilter<T extends DataContainer> extends Object
Ancestor for global filters that are used to filter data containers coming from the database or from files.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected HashSet<GlobalDataContainerFilterChangeListener>
m_ChangeListeners
the listeners in case of changes to the filter.protected Filter<T>
m_DefaultFilter
the filter to apply to the data before caching.protected Filter<T>
m_Filter
the filter being used in this table object.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractGlobalDataContainerFilter()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(GlobalDataContainerFilterChangeListener l)
Adds a listener for connect/disconnect events to the internal list.T
filter(T c)
Filters the data with the currently set filter.Filter
getFilter()
Returns the filter used to pre-process the data before it is cached.protected void
notifyChangeListeners(GlobalDataContainerFilterChangeEvent e)
Notifies all listeners with the given event.void
removeChangeListener(GlobalDataContainerFilterChangeListener l)
Removes a listener for connect/disconnect events from the internal list.void
setFilter(Filter value)
Sets the filter to run over the data before it is cached.protected void
setupFilter()
Sets up the filter to use for filtering the containers before they're put in the cache.
-
-
-
Field Detail
-
m_DefaultFilter
protected Filter<T extends DataContainer> m_DefaultFilter
the filter to apply to the data before caching.
-
m_Filter
protected Filter<T extends DataContainer> m_Filter
the filter being used in this table object.
-
m_ChangeListeners
protected HashSet<GlobalDataContainerFilterChangeListener> m_ChangeListeners
the listeners in case of changes to the filter.
-
-
Method Detail
-
setFilter
public void setFilter(Filter value)
Sets the filter to run over the data before it is cached.- Parameters:
value
- the filter
-
getFilter
public final Filter getFilter()
Returns the filter used to pre-process the data before it is cached.- Returns:
- the filter
-
setupFilter
protected void setupFilter()
Sets up the filter to use for filtering the containers before they're put in the cache.
-
filter
public T filter(T c)
Filters the data with the currently set filter.- Parameters:
c
- the container to filter- Returns:
- the filtered container
- See Also:
m_Filter
-
addChangeListener
public void addChangeListener(GlobalDataContainerFilterChangeListener l)
Adds a listener for connect/disconnect events to the internal list.- Parameters:
l
- the listener to add
-
removeChangeListener
public void removeChangeListener(GlobalDataContainerFilterChangeListener l)
Removes a listener for connect/disconnect events from the internal list.- Parameters:
l
- the listener to remove
-
notifyChangeListeners
protected void notifyChangeListeners(GlobalDataContainerFilterChangeEvent e)
Notifies all listeners with the given event.- Parameters:
e
- the event to send to the listeners
-
-