org.ikasan.connector.basefiletransfer.net
Class ClientPolarisedFilter

java.lang.Object
  extended by org.ikasan.connector.basefiletransfer.net.ClientPolarisedFilter

public class ClientPolarisedFilter
extends java.lang.Object

Utility class to hold and apply an 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.

Author:
Ikasan Development Team

Field Summary
 ClientFilter filter
          client filter
 boolean polarity
          Polartiy flag
 
Constructor Summary
ClientPolarisedFilter(ClientFilter filter, boolean polarity)
          Default constructor
 
Method Summary
 java.util.List<ClientListEntry> applyFilter(java.util.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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

public ClientFilter filter
client filter


polarity

public boolean polarity
Polartiy flag

Constructor Detail

ClientPolarisedFilter

public ClientPolarisedFilter(ClientFilter filter,
                             boolean polarity)
Default constructor

Parameters:
filter - The relative ClientFilter to apply
polarity - false to negate the filter results when the filter is applied; true otherwise.
Method Detail

applyFilter

public java.util.List<ClientListEntry> applyFilter(java.util.List<ClientListEntry> list)
Applies the ClientFilter on the List<ClientListEntry> and return the resulting polarised filtered list.

Parameters:
list -
Returns:
The resulting List<ClientListEntry>.

getFilter

public ClientFilter getFilter()
Returns:
the filter

setFilter

public void setFilter(ClientFilter filter)
Parameters:
filter - the filter to set

isPolarity

public boolean isPolarity()
Returns:
the polarisation

setPolarity

public void setPolarity(boolean polarity)
Parameters:
polarity - the polarisation to set


Copyright © 2007-2010 Ikasan. All Rights Reserved.