Class AdHocRootedGraphModel<V>

java.lang.Object
eu.bandm.tools.graph.AdHocRootedGraphModel<V>
All Implemented Interfaces:
GraphModel<V>, RootedGraphModel<V>

public class AdHocRootedGraphModel<V> extends Object implements RootedGraphModel<V>
  • Constructor Details

    • AdHocRootedGraphModel

      @SafeVarargs public AdHocRootedGraphModel(GraphModel<V> parent, V... roots)
    • AdHocRootedGraphModel

      public AdHocRootedGraphModel(GraphModel<V> parent, Collection<? extends V> roots)
    • AdHocRootedGraphModel

      public AdHocRootedGraphModel(GraphModel<V> parent, V root)
  • Method Details

    • neighbours

      public Collection<? extends V> neighbours(V node)
      Description copied from interface: GraphModel
      Return all nodes to which there is an edge from a given node. The order of nodes may or may not be significant to the application; it is ignored by all algorithms in this package. Multiple occurrences of the same node may or may not imply multiple edges, depending on the context.

      A return value of null indicates that the given node object is not part of the graph covered by this graph model. A graph model is called closed iff neighbours(v).contains(w) implies neighbours(w) != null for all node objects v, w. All traversal algorithms require graph models to be closed.

      Specified by:
      neighbours in interface GraphModel<V>
      Parameters:
      node - a node
      Returns:
      a read-only collection containing all neighbours of node, or null if node is not a node of the graph represented by this model.
    • roots

      public Collection<? extends V> roots()
      Specified by:
      roots in interface RootedGraphModel<V>