Class AbstractNetworkQuery<T>
- java.lang.Object
-
- repast.simphony.query.space.graph.AbstractNetworkQuery<T>
-
- All Implemented Interfaces:
Query<T>
- Direct Known Subclasses:
NetworkAdjacent
,NetworkPredecessor
,NetworkSuccessor
public abstract class AbstractNetworkQuery<T> extends Object implements Query<T>
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNetworkQuery(Context<T> context, T obj)
Creates a network query that will query any networks in the specified context using the specified object.protected
AbstractNetworkQuery(Network<T> network, T obj)
Creates a network query that will query the specified network using the specified object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Iterator<T>
getNetNghIterable(Network<T> net)
Implementor should return the iterator appropriate to their query.Iterable<T>
query()
Gets an iterable over a collection of nodes.Iterable<T>
query(Iterable<T> iter)
Gets an iterable over the collection of nodes returned by this query.
-
-
-
Field Detail
-
target
protected T target
-
-
Method Detail
-
query
public Iterable<T> query()
Gets an iterable over a collection of nodes. The actual members of this set will be determined by sub-classes. For example, the NetworkAdjacent query will return an iterable over nodes that are adjacent to the node specified in the constructor.
-
getNetNghIterable
protected abstract Iterator<T> getNetNghIterable(Network<T> net)
Implementor should return the iterator appropriate to their query. For example, an network adjacent query would return an iterator over the nodes adjacent to the target node specified in the constructor.- Parameters:
net
-- Returns:
- the iterator appropriate to the implemented query.
-
query
public Iterable<T> query(Iterable<T> iter)
Gets an iterable over the collection of nodes returned by this query. where the members of that collection are also part of the specified iterable parameter. The actual members of the iterable returned by the query will be determined by sub-classes. For example, the NetworkAdjacent query will return an iterable over nodes that are adjacent to the node specified in the constructor.
-
-