Class AbstractGeometryQuery<T>

java.lang.Object
repast.simphony.query.space.gis.AbstractGeometryQuery<T>
All Implemented Interfaces:
Query<T>
Direct Known Subclasses:
ContainsQuery, IntersectsQuery, TouchesQuery, WithinQuery

public abstract class AbstractGeometryQuery<T> extends Object implements Query<T>
Abstract implementation of geometry based queries. This can be used as the basis for queries can performed on the basis of intersection with a source object's geometry.
  • Field Details

    • geography

      protected Geography<T> geography
    • geom

      protected org.locationtech.jts.geom.Geometry geom
    • predicate

      protected org.apache.commons.collections15.Predicate<T> predicate
    • sourceObject

      protected T sourceObject
  • Constructor Details

    • AbstractGeometryQuery

      public AbstractGeometryQuery(Geography<T> geography, T sourceObject)
    • AbstractGeometryQuery

      public AbstractGeometryQuery(Geography<T> geography, org.locationtech.jts.geom.Geometry geom)
  • Method Details

    • createPredicate

      protected abstract org.apache.commons.collections15.Predicate<T> createPredicate()
      Create a predicate that will be used to test objects that intersect the source object. Those that pass the predicate evaluate will be included in the query results.
      Returns:
      Create a predicate that will be used to test objects that intersect the source object.
    • query

      public Iterable<T> query(Iterable<T> set)
      Returns an iterable over the objects that are the result of the query and are in the passed in iterable. This allows queries to be chained together where the result of one query is passed into another.
      Specified by:
      query in interface Query<T>
      Parameters:
      set - the iterable to test for inclusion
      Returns:
      an iterable over the objects that are the result of the query and are in the passed in iterable.
    • query

      public Iterable<T> query()
      Returns the result of the query.
      Specified by:
      query in interface Query<T>
      Returns:
      an iterable over the objects that are the result of the query.