Class TLcdFilteredFunction

java.lang.Object
com.luciad.util.TLcdFilteredFunction
All Implemented Interfaces:
ILcdFunction

public class TLcdFilteredFunction extends Object implements ILcdFunction
An ILcdFunction decorator the adds filtering capabilities to an existing function. Before applying the existing function on an object, this function will first test if the object passes a specified filter. If the filter is set to null, no filtering is done and this function will directly delegate to the existing function.
  • Constructor Details

    • TLcdFilteredFunction

      public TLcdFilteredFunction(ILcdFunction aFunction)
      Creates a new filtered function using a specified function. The new filtered function will not perform filtering until a filter has been set.
      Parameters:
      aFunction - the actual function to apply to objects.
      See Also:
  • Method Details

    • getFunction

      public ILcdFunction getFunction()
      Returns the actual function that is applied to objects if they have been accepted by the current filter.
      Returns:
      the actual function
      See Also:
    • setFunction

      public void setFunction(ILcdFunction aFunction)
      Sets the actual to function to apply when objects have been accepted by the current filter.
      Parameters:
      aFunction - the new function to apply
      See Also:
    • getFilter

      public ILcdFilter getFilter()
      Returns the current filter.
      Returns:
      the current filter
      See Also:
    • setFilter

      public void setFilter(ILcdFilter aFilter)
      Sets the filter to use when applying this function.
      Parameters:
      aFilter - the new filter
      See Also:
    • applyOn

      public boolean applyOn(Object o) throws IllegalArgumentException
      Applies the currently set function to the specified object if this object is accepted by the current filter. If the object is not accepted, this method simply returns.
      Specified by:
      applyOn in interface ILcdFunction
      Parameters:
      o - the object on which to apply the current function
      Returns:
      true if the object was accepted by the filter and the function was applied successfully; false otherwise
      Throws:
      IllegalArgumentException - when the specified object is not a valid argument for the current function
      See Also: