public class ClientPolarisedFilter extends Object
ClientFilter and return
results via a public applyFilter() method. This class allows
one to polarise the list of results returned by negating or accepting the
result of the ClientFilter.match() call.
For example:
If one applies the ClientDirectoryFilter on a list of
ClientListEntry objects, the filtered list will by default
contain all the matched entries which are directories. If the opposite is
required, then this class can be used with negative polarity (i.e. set to
polarity = false to return everything but the directories.| Modifier and Type | Field and Description |
|---|---|
ClientFilter |
filter
client filter
|
boolean |
polarity
Polartiy flag
|
| Constructor and Description |
|---|
ClientPolarisedFilter(ClientFilter filter,
boolean polarity)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
List<ClientListEntry> |
applyFilter(List<ClientListEntry> list)
Applies the
ClientFilter on the
List<ClientListEntry> and return the resulting
polarised filtered list. |
ClientFilter |
getFilter() |
boolean |
isPolarity() |
void |
setFilter(ClientFilter filter) |
void |
setPolarity(boolean polarity) |
public ClientFilter filter
public boolean polarity
public ClientPolarisedFilter(ClientFilter filter, boolean polarity)
filter - The relative ClientFilter to applypolarity - false to negate the filter results when
the filter is applied; true otherwise.public List<ClientListEntry> applyFilter(List<ClientListEntry> list)
ClientFilter on the
List<ClientListEntry> and return the resulting
polarised filtered list.list - List<ClientListEntry>.public ClientFilter getFilter()
public void setFilter(ClientFilter filter)
filter - the filter to setpublic boolean isPolarity()
public void setPolarity(boolean polarity)
polarity - the polarisation to setCopyright © 2007-2017 Ikasan. All Rights Reserved.