com.levigo.util.base.glazedlists.matchers
Class AbstractMatcherEditor<E>

java.lang.Object
  extended by com.levigo.util.base.glazedlists.matchers.AbstractMatcherEditor<E>
All Implemented Interfaces:
MatcherEditor<E>
Direct Known Subclasses:
CompositeMatcherEditor, RangeMatcherEditor, TextMatcherEditor, ThreadedMatcherEditor, ThresholdMatcherEditor

public abstract class AbstractMatcherEditor<E>
extends Object
implements MatcherEditor<E>

Basic building block for MatcherEditor implementations that handles the details of dealing with registered MatcherEditor.Listeners. All MatcherEditor implementations should extend this class for its convenience methods.

Extending classes can fire events to registered listeners using the "fire" methods:

Author:
Rob Eden

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.levigo.util.base.glazedlists.matchers.MatcherEditor
MatcherEditor.Event<E>, MatcherEditor.Listener<E>
 
Field Summary
protected  Matcher<E> currentMatcher
          the current Matcher in effect
 
Constructor Summary
AbstractMatcherEditor()
           
 
Method Summary
 void addMatcherEditorListener(MatcherEditor.Listener<E> listener)
          Add a listener to be notified when this editor's Matcher changes.
protected  void fireChanged(Matcher<E> matcher)
          Indicates that the filter has changed in an indeterminate way.
protected  void fireChangedMatcher(MatcherEditor.Event<E> event)
           
protected  void fireConstrained(Matcher<E> matcher)
          Indicates that the filter has changed to be more restrictive.
protected  void fireMatchAll()
          Indicates that the filter matches all.
protected  void fireMatchNone()
          Indicates that the filter matches none.
protected  void fireRelaxed(Matcher<E> matcher)
          Indicates that the filter has changed to be less restrictive.
 Matcher<E> getMatcher()
          Return the current Matcher specified by this MatcherEditor.
protected  boolean isCurrentlyMatchingAll()
          Returns true if the current matcher will match everything.
protected  boolean isCurrentlyMatchingNone()
          Returns true if the current matcher will match nothing.
 void removeMatcherEditorListener(MatcherEditor.Listener<E> listener)
          Remove the listener so that it no longer receives notification when the Matcher changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentMatcher

protected Matcher<E> currentMatcher
the current Matcher in effect

Constructor Detail

AbstractMatcherEditor

public AbstractMatcherEditor()
Method Detail

getMatcher

public Matcher<E> getMatcher()
Return the current Matcher specified by this MatcherEditor.

Specified by:
getMatcher in interface MatcherEditor<E>
Returns:
a non-null Matcher.

addMatcherEditorListener

public final void addMatcherEditorListener(MatcherEditor.Listener<E> listener)
Add a listener to be notified when this editor's Matcher changes.

Specified by:
addMatcherEditorListener in interface MatcherEditor<E>

removeMatcherEditorListener

public final void removeMatcherEditorListener(MatcherEditor.Listener<E> listener)
Remove the listener so that it no longer receives notification when the Matcher changes.

Specified by:
removeMatcherEditorListener in interface MatcherEditor<E>

fireMatchAll

protected final void fireMatchAll()
Indicates that the filter matches all.


fireChanged

protected final void fireChanged(Matcher<E> matcher)
Indicates that the filter has changed in an indeterminate way.


fireConstrained

protected final void fireConstrained(Matcher<E> matcher)
Indicates that the filter has changed to be more restrictive. This should only be called if all currently filtered items will remain filtered.


fireRelaxed

protected final void fireRelaxed(Matcher<E> matcher)
Indicates that the filter has changed to be less restrictive. This should only be called if all currently unfiltered items will remain unfiltered.


fireMatchNone

protected final void fireMatchNone()
Indicates that the filter matches none.


isCurrentlyMatchingAll

protected final boolean isCurrentlyMatchingAll()
Returns true if the current matcher will match everything.


isCurrentlyMatchingNone

protected final boolean isCurrentlyMatchingNone()
Returns true if the current matcher will match nothing.


fireChangedMatcher

protected final void fireChangedMatcher(MatcherEditor.Event<E> event)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.