public class TLcdFilteredFunction extends Object implements ILcdFunction
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 and Description |
---|
TLcdFilteredFunction(ILcdFunction aFunction)
Creates a new filtered function using a specified function.
|
Modifier and Type | Method and Description |
---|---|
boolean |
applyOn(Object o)
Applies the currently set function to the specified object if this object is accepted by the current
filter.
|
ILcdFilter |
getFilter()
Returns the current filter.
|
ILcdFunction |
getFunction()
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.
|
public TLcdFilteredFunction(ILcdFunction aFunction)
aFunction
- the actual function to apply to objects.setFilter(com.luciad.util.ILcdFilter)
public ILcdFunction getFunction()
setFunction(com.luciad.util.ILcdFunction)
public void setFunction(ILcdFunction aFunction)
aFunction
- the new function to applygetFunction()
public ILcdFilter getFilter()
setFilter(com.luciad.util.ILcdFilter)
public void setFilter(ILcdFilter aFilter)
aFilter
- the new filtergetFilter()
public boolean applyOn(Object o) throws IllegalArgumentException
applyOn
in interface ILcdFunction
o
- the object on which to apply the current functionIllegalArgumentException
- when the specified object is not a valid argument for the current functiongetFunction()
,
getFilter()