Class AbstractNetworkQuery<T>

    • Field Detail

      • target

        protected T target
    • Constructor Detail

      • 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 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.
        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.