Class 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 Detail

      • 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