Package repast.simphony.query.space.grid
Class MooreQuery<T>
java.lang.Object
repast.simphony.query.space.grid.AbstractGridQuery<T>
repast.simphony.query.space.grid.MooreQuery<T>
- All Implemented Interfaces:
Query<T>
Queries a grid for the Moore neighborhood of a specific point or object. This
works with 1, 2, and 3 dimensions.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMooreQuery
(Grid<T> grid, T source, int... extent) Creates a Moore query on the specified grid using the specified object as the source where the neighborhood is specified by the extent. -
Method Summary
Modifier and TypeMethodDescriptionquery()
Gets an iterable over all the objects that make up the Moore neighborhood of the source object.Gets an iterable over all the objects that make up the Moore neighborhood of the source object and are in the specified iterable.Methods inherited from class repast.simphony.query.space.grid.AbstractGridQuery
reset
-
Constructor Details
-
MooreQuery
Creates a Moore query on the specified grid using the specified object as the source where the neighborhood is specified by the extent. The extent defines the dimensions of the neighborhood in the x, y, and optionaly z dimensions. If the extent args are missing, they default to one.This object can be reused by resetting the source and extents using the
reset
method. The queries will return an empty iterable if the source object does not have a grid location.- Parameters:
grid
-source
-extent
-
-
-
Method Details
-
query
Gets an iterable over all the objects that make up the Moore neighborhood of the source object. The source object and neighborhood extent are specified in the constructor or the reset method. The order of the objects returned is back to front by column starting with the left side column.This will return an empty iterable if the source object does not have a grid location.
- Returns:
- an iterable over all the objects that make up the Moore neighborhood of the source object.
-
query
Gets an iterable over all the objects that make up the Moore neighborhood of the source object and are in the specified iterable. The source object and neighborhood extent are specified in the constructor or the reset method. The order of the objects returned is back to front by column starting with the left side column.This will return an empty iterable if the source object does not have a grid location.
- Returns:
- an iterable over all the objects that make up the Moore neighborhood of the source object and are in the spefied iterable.
-