|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.data.provider.impl.BasicTableDataFilter
public class BasicTableDataFilter
This basic implementation of TableDataFilter iterates rows and the
contained FilterCriteria
and invokes the match()
method
on each. If the matchAllCriteria
property is set to
true
, then all of the filter criteria must report either a
positive match for an include criteria, or a negative match for an exclude
criteria for a row to be accepted by the filter. If the
matchAllCriteria
property is set to false
(match
any), then any include criteria that matches a row or exclude criteria
that does not match a row will cause the row to be accepted by the filter.
If there is no filter criteria defined, all rows will be accepted.
Field Summary | |
---|---|
protected FilterCriteria[] |
filterCriteria
storage for the filter criteria |
protected boolean |
matchAll
storage for the matchAllCriteria property (default is true ) |
Constructor Summary | |
---|---|
BasicTableDataFilter()
|
Method Summary | |
---|---|
RowKey[] |
filter(TableDataProvider provider,
RowKey[] rows)
This method iterates the passed rows and contained FilterCriteria and invokes the match() method on
each. |
FilterCriteria[] |
getFilterCriteria()
Returns the current filter criteria on this data filterer. |
boolean |
isMatchAllCriteria()
Gets the matchAllCriteria property. |
void |
setFilterCriteria(FilterCriteria[] filterCriteria)
Sets the filter criteria on this data filter. |
void |
setMatchAllCriteria(boolean matchAll)
Sets the matchAllCriteria property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FilterCriteria[] filterCriteria
protected boolean matchAll
true
)
Constructor Detail |
---|
public BasicTableDataFilter()
Method Detail |
---|
public void setFilterCriteria(FilterCriteria[] filterCriteria)
Sets the filter criteria on this data filter.
setFilterCriteria
in interface TableDataFilter
filterCriteria
- An array of FilterCriteria
objects defining
the filter order on this TableDataFilterpublic FilterCriteria[] getFilterCriteria()
Returns the current filter criteria on this data filterer.
getFilterCriteria
in interface TableDataFilter
public void setMatchAllCriteria(boolean matchAll)
Sets the matchAllCriteria property. When set to true
,
the accept(...)
method to only accept rows that are
matched by all include filter criteria and not mached by all exclude
filter criteria. When set to false
, the
accept(...)
method will accept an row if it is matched
by any include filter criteria or not matched by any exclude filter
criteria.
matchAll
- The desired setting for the matchAllCriteria propertypublic boolean isMatchAllCriteria()
Gets the matchAllCriteria property. When set to true
,
the accept(...)
method to only accept rows that are
matched by all include filter criteria and not mached by all exclude
filter criteria. When set to false
, the
accept(...)
method will accept an row if it is matched
by any include filter criteria or not matched by any exclude filter
criteria.
public RowKey[] filter(TableDataProvider provider, RowKey[] rows) throws DataProviderException
This method iterates the passed rows and contained
FilterCriteria
and invokes the match()
method on
each. If the matchAllCriteria
property is set to
true
, then all of the include filter criteria must match a
row, and all of the exclude filter criteria must not match a row for that
row to be accepted by the filter. If the matchAllCriteria
property is set to false
(match any), then any include
criteria that matches a row or exclude criteria that does not match a row
will cause that row to be excluded. If there is no filter criteria
defined, then this method returns the passed-in rows, effectively
accepting all rows.
Performs a filter operation on the passed set of RowKey
objects. Typically, the contained FilterCriteria objects will be
iterated for each row and their match(...)
method will be
called in conjunction with their isInclude()
method to
determine if a row should be displayed or not.
NOTE: If a component is bound to an TableDataProvider
and
an TableDataFilter, which are the *same* instance, this method is never
called. The filter is assumed to be intrinsic in the row data of the
TableDataProvider
, based on the currently set filter criteria.
filter
in interface TableDataFilter
provider
- TableDataProvider
containing the data on displayrows
- An array of RowKey
to be filtered. If this is
null
, then the return value should be
null
or an empty array of RowKeys.
RowKey
representing the result of the filter
operation
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed TableDataProvider or RowKeys are not valid. Consult the
documentation of the specific TableDataFilter implementation for
details on what exceptions might be wrapped by a DPE.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |