ca.odell.glazedlists.matchers
Class ThresholdMatcherEditor<E>

java.lang.Object
  extended by ca.odell.glazedlists.matchers.AbstractMatcherEditor<E>
      extended by ca.odell.glazedlists.matchers.ThresholdMatcherEditor<E>
All Implemented Interfaces:
MatcherEditor<E>

public class ThresholdMatcherEditor<E>
extends AbstractMatcherEditor<E>

A MatcherEditor that filters elements based on whether they are greater than or less than a threshold. The implementation is based on elements implementing Comparable unless the constructor specifies a Comparator.

Author:
Rob Eden

Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.odell.glazedlists.matchers.MatcherEditor
MatcherEditor.Event<E>, MatcherEditor.Listener<E>
 
Field Summary
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation EQUAL
           
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation GREATER_THAN
           
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation GREATER_THAN_OR_EQUAL
           
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation LESS_THAN
           
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation LESS_THAN_OR_EQUAL
           
static ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation NOT_EQUAL
           
 
Constructor Summary
ThresholdMatcherEditor()
          Construct an instance that will require elements to be greater than the threshold (which is not initially set) and relies on the thresold object and elements in the list implementing Comparable.
ThresholdMatcherEditor(E threshold)
          Construct an instance that will require elements to be greater than the given threshold and relies on the thresold object and elements in the list implementing Comparable.
ThresholdMatcherEditor(E threshold, ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation)
          Construct an instance that will require elements to be greater than the given threshold and relies on the thresold object and elements in the list implementing Comparable.
ThresholdMatcherEditor(E threshold, ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation, Comparator<E> comparator)
          Construct an instance.
 
Method Summary
 Comparator<E> getComparator()
          See setComparator(java.util.Comparator).
 ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation getMatchOperation()
          See setMatchOperation(ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation).
 E getThreshold()
          See getThreshold().
 void setComparator(Comparator<E> comparator)
          Update the comparator.
 void setMatchOperation(ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation)
          Update the operation used to determine what relation list elements should have to the threshold in order to match (i.e., be visible).
 void setThreshold(E threshold)
          Update the threshold used to determine what is matched by the list.
 
Methods inherited from class ca.odell.glazedlists.matchers.AbstractMatcherEditor
addMatcherEditorListener, fireChanged, fireChangedMatcher, fireConstrained, fireMatchAll, fireMatchNone, fireRelaxed, getMatcher, removeMatcherEditorListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GREATER_THAN

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation GREATER_THAN

GREATER_THAN_OR_EQUAL

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation GREATER_THAN_OR_EQUAL

LESS_THAN

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation LESS_THAN

LESS_THAN_OR_EQUAL

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation LESS_THAN_OR_EQUAL

EQUAL

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation EQUAL

NOT_EQUAL

public static final ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation NOT_EQUAL
Constructor Detail

ThresholdMatcherEditor

public ThresholdMatcherEditor()
Construct an instance that will require elements to be greater than the threshold (which is not initially set) and relies on the thresold object and elements in the list implementing Comparable.


ThresholdMatcherEditor

public ThresholdMatcherEditor(E threshold)
Construct an instance that will require elements to be greater than the given threshold and relies on the thresold object and elements in the list implementing Comparable.

Parameters:
threshold - The initial threshold, or null if none.

ThresholdMatcherEditor

public ThresholdMatcherEditor(E threshold,
                              ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation)
Construct an instance that will require elements to be greater than the given threshold and relies on the thresold object and elements in the list implementing Comparable.

Parameters:
threshold - The initial threshold, or null if none.
operation - The operation to determine what relation list elements should have to the threshold in order to match (i.e., be visible). Specifying null will use GREATER_THAN.

ThresholdMatcherEditor

public ThresholdMatcherEditor(E threshold,
                              ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation,
                              Comparator<E> comparator)
Construct an instance.

Parameters:
threshold - The initial threshold, or null if none.
operation - The operation to determine what relation list elements should have to the threshold in order to match (i.e., be visible). Specifying null will use GREATER_THAN.
comparator - Determines how objects compare. If null, the threshold object and list elements must implement Comparable.
Method Detail

setThreshold

public void setThreshold(E threshold)
Update the threshold used to determine what is matched by the list. This coupled with the match operation determines what's matched.

Parameters:
threshold - The threshold, or null to match everything.

getThreshold

public E getThreshold()
See getThreshold().


setMatchOperation

public void setMatchOperation(ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation operation)
Update the operation used to determine what relation list elements should have to the threshold in order to match (i.e., be visible). Must be non-null.

See Also:
GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, EQUAL, NOT_EQUAL

getMatchOperation

public ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation getMatchOperation()
See setMatchOperation(ca.odell.glazedlists.matchers.ThresholdMatcherEditor.MatchOperation).


setComparator

public void setComparator(Comparator<E> comparator)
Update the comparator. Setting to null will require that thresholds and elements in the list implement Comparable.


getComparator

public Comparator<E> getComparator()
See setComparator(java.util.Comparator).



Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by jessewilson at 2006-08-09 23:05