Package repast.simphony.query
Class WithinDistance<T>
java.lang.Object
repast.simphony.query.WithinDistance<T>
- All Implemented Interfaces:
Query<T>
- Direct Known Subclasses:
ContinuousWithin
,GridWithin
Base class for queries whose results contains all the objects within some distance of a
specified object.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
WithinDistance
(Context<T> context, double distance, T obj) Creates a WithinDistance query whose results will be all the objects in all the projections of a particular type in the context within some distance of the specified object. -
Method Summary
Modifier and TypeMethodDescriptionCreates an iterable over all the relevant objects in a space.createIterable
(Context<T> context) Creates an iterable over all the relevant objects in the context.query()
Returns the result of the query.Returns an iterable over the objects that are the result of the query and are in the passed in iterable.
-
Field Details
-
EMPTY
-
obj
-
distanceSq
protected double distanceSq -
distance
protected double distance
-
-
Constructor Details
-
WithinDistance
Creates a WithinDistance query whose results will be all the objects in all the projections of a particular type in the context within some distance of the specified object. Subclasses will determine the projection type.- Parameters:
context
-distance
-obj
-
-
-
Method Details
-
query
Returns the result of the query. -
createIterable
Creates an iterable over all the relevant objects in the context.- Parameters:
context
-- Returns:
- an iterable over all the relevant objects in the context.
-
createIterable
Creates an iterable over all the relevant objects in a space. The actual space will depend on subclass implementations.- Returns:
- an iterable over all the relevant objects in a space. The actual space will depend on subclass implementations.
-
query
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.
-