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
public abstract class WithinDistance<T> extends Object implements Query<T>
Base class for queries whose results contains all the objects within some distance of a specified object.- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Iterable<T>
createIterable()
Creates an iterable over all the relevant objects in a space.protected abstract Iterable<T>
createIterable(Context<T> context)
Creates an iterable over all the relevant objects in the context.Iterable<T>
query()
Returns the result of the query.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.
-
-
-
Constructor Detail
-
WithinDistance
protected 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. Subclasses will determine the projection type.- Parameters:
context
-distance
-obj
-
-
-
Method Detail
-
createIterable
protected abstract Iterable<T> createIterable(Context<T> context)
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
protected abstract Iterable<T> 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.
-
-