Class IdentifierFilter<R extends AbstractFeature>

Type Parameters:
R - the type of resources used as inputs.
All Implemented Interfaces:
Serializable, Predicate<R>, Filter<R>

final class IdentifierFilter<R extends AbstractFeature> extends FilterNode<R>
Filter features using a set of predefined identifiers and discarding features whose identifier is not in the set.
Since:
1.1
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • identifier

      private final String identifier
      The identifier of features to retain.
  • Constructor Details

    • IdentifierFilter

      IdentifierFilter(String identifier)
      Creates a new filter using the given identifier.
  • Method Details

    • getOperatorType

      public Enum<?> getOperatorType()
      Description copied from interface: Filter
      Returns the nature of the operator.
      Returns:
      the nature of this operator.
    • getIdentifier

      public String getIdentifier()
      Returns the identifiers of feature instances to accept.
    • getExpressions

      public List<Expression<? super R,?>> getExpressions()
      Returns the parameters of this filter.
      Returns:
      the expressions used as inputs, or an empty list if none.
    • getChildren

      protected Collection<?> getChildren()
      Returns the identifiers specified at construction time. This is used for Node.toString(), Node.hashCode() and Node.equals(Object) implementations.
      Specified by:
      getChildren in class Node
      Returns:
      the children of this node, or an empty collection if none.
    • test

      public boolean test(R object)
      Returns true if the given object is a AbstractFeature instance and its identifier is one of the identifier specified at IdentifierFilter construction time.
      Parameters:
      object - the object (often a Feature instance) to evaluate.
      Returns:
      true if the test(s) are passed for the provided object.