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
  • Field Details

    • target

      protected T target
  • Constructor Details

    • AbstractNetworkQuery

      protected AbstractNetworkQuery(Context<T> context, T obj)
      Creates a network query that will query any networks in the specified context using the specified object.
      Parameters:
      context -
      obj -
    • AbstractNetworkQuery

      protected AbstractNetworkQuery(Network<T> network, T obj)
      Creates a network query that will query the specified network using the specified object.
      Parameters:
      network -
      obj -
  • Method Details

    • 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.
      Specified by:
      query in interface Query<T>
      Returns:
      an iterable over a collection of nodes.
    • 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.
      Specified by:
      query in interface Query<T>
      Returns:
      an iterable over a collection of nodes.