Package com.luciad.util
Class TLcdFilteredFunction
java.lang.Object
com.luciad.util.TLcdFilteredFunction
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionTLcdFilteredFunction
(ILcdFunction aFunction) Creates a new filtered function using a specified function. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Applies the currently set function to the specified object if this object is accepted by the current filter.Returns the current filter.Returns the actual function that is applied to objects if they have been accepted by the current filter.void
setFilter
(ILcdFilter aFilter) Sets the filter to use when applying this function.void
setFunction
(ILcdFunction aFunction) Sets the actual to function to apply when objects have been accepted by the current filter.
-
Constructor Details
-
TLcdFilteredFunction
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
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
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
Returns the current filter.- Returns:
- the current filter
- See Also:
-
setFilter
Sets the filter to use when applying this function.- Parameters:
aFilter
- the new filter- See Also:
-
applyOn
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 interfaceILcdFunction
- 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:
-