Class TLcdDefaultObjectInModelFilter

java.lang.Object
com.luciad.model.TLcdDefaultObjectInModelFilter
All Implemented Interfaces:
ILcdFilter, Serializable, Predicate

public class TLcdDefaultObjectInModelFilter extends Object implements ILcdFilter
An ILcdFilter that only accepts objects which are contained in the ILcdModel set on this filter.

This filter uses different mechanisms, depending on the interface(s) implemented by the model and object to be tested:

  • If the model implements ILcdIntegerIndexedModel, the filter calls indexOf(Object).
  • If the model implements ILcd2DBoundsIndexedModel and the object is ILcdBounded, the filter calls applyOnInteract on the (reduced) bounds of the object.
  • Otherwise, the filter compares the object with all elements of the model. This approach can be slow for large models, and should be avoided if possible!
See Also:
  • Constructor Details

    • TLcdDefaultObjectInModelFilter

      public TLcdDefaultObjectInModelFilter()
      Constructs a new TLcdDefaultObjectInModelFilter. A model should be set on this filter afterwards.
    • TLcdDefaultObjectInModelFilter

      public TLcdDefaultObjectInModelFilter(ILcdModel aModel)
      Constructs a new TLcdDefaultObjectInModelFilter for the specified model.
      Parameters:
      aModel - the ILcdModel in which to search for objects.
  • Method Details

    • setModel

      public void setModel(ILcdModel aModel)
      Sets the ILcdModel in which to search for objects.
      Parameters:
      aModel - the ILcdModel in which to search for objects.
    • accept

      public boolean accept(Object aObject)
      Returns true if the specified object is contained in this filter's model, false otherwise.
      Specified by:
      accept in interface ILcdFilter
      Parameters:
      aObject - the object to be tested.
      Returns:
      true if the specified object is contained in this filter's model, false otherwise.