public class RangeMatcherEditor<D extends Comparable,E> extends AbstractMatcherEditor<E>
Comparable
s. This RangeMatcherEditor
is not coupled with any UI component that
allows the user to edit the range. That job is left to subclasses. This MatcherEditor is fully
concrete, and may be used directly by headless applications.
The RangeMatcherEditor
requires that either a Filterator
appropriate for
extracting Comparable
objects be specified in its constructor, or that every Object to be
matched is a Comparable
.
MatcherEditor.Event<E>, MatcherEditor.Listener<E>
Constructor and Description |
---|
RangeMatcherEditor()
Creates a
RangeMatcherEditor whose Matchers can test only elements which are
Comparable objects. |
RangeMatcherEditor(Filterator<D,E> filterator)
Creates a
RangeMatcherEditor that matches Objects using the specified
Filterator to get the Comparable s to search. |
Modifier and Type | Method and Description |
---|---|
Filterator<D,E> |
getFilterator()
Get the filterator used to extract Comparables from the matched elements.
|
void |
setRange(D newStart,
D newEnd)
This method is used to change the range currently matched by this MatcherEditor.
|
fireChanged, fireConstrained, fireMatchAll, fireMatchNone, fireRelaxed, getMatcher, isCurrentlyMatchingAll, isCurrentlyMatchingNone
addMatcherEditorListener, createChangedEvent, createConstrainedEvent, createMatchAllEvent, createMatchNoneEvent, createRelaxedEvent, fireChangedMatcher, removeMatcherEditorListener
public RangeMatcherEditor()
RangeMatcherEditor
whose Matchers can test only elements which are
Comparable
objects.
The Matcher
s from this MatcherEditor
will throw a ClassCastException
when Matcher.matches(E)
is called with an Object that is not a Comparable
.
public RangeMatcherEditor(Filterator<D,E> filterator)
RangeMatcherEditor
that matches Objects using the specified
Filterator
to get the Comparable
s to search.filterator
- the object that will extract filter Comparables from each object in the
source
; null
indicates the list elements are Comparablespublic Filterator<D,E> getFilterator()
public void setRange(D newStart, D newEnd)
null
values for either newStart
or newEnd
indicate there
is no start of end to the range respectively. Consequently, calling
setRange(null, null)
causes this matcher editor match all values it filters.
Note: if newStart
and newEnd
are out of their natural order with
respect to each other, their values are swapped. For example,
setRange(Jan 1, 2006, Jan 1, 1955)
would swap the values so newStart
is Jan 1, 1955
and newEnd
is Jan 1, 2006
.
newStart
- the new value marking the start of the range; null
indicates there
is no startnewEnd
- the new value marking the start of the range; null
indicates there
is no startCopyright © 2024 levigo holding gmbh. All rights reserved.