public class AdHocRootedGraphModel<V> extends Object implements RootedGraphModel<V>
Constructor and Description |
---|
AdHocRootedGraphModel(GraphModel<V> parent,
Collection<? extends V> roots) |
AdHocRootedGraphModel(GraphModel<V> parent,
V... roots) |
AdHocRootedGraphModel(GraphModel<V> parent,
V root) |
Modifier and Type | Method and Description |
---|---|
Collection<? extends V> |
neighbours(V node)
Return all nodes to which there is an edge from a given node.
|
Collection<? extends V> |
roots() |
@SafeVarargs public AdHocRootedGraphModel(GraphModel<V> parent, V... roots)
public AdHocRootedGraphModel(GraphModel<V> parent, Collection<? extends V> roots)
public AdHocRootedGraphModel(GraphModel<V> parent, V root)
public Collection<? extends V> neighbours(V node)
GraphModel
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.
neighbours
in interface GraphModel<V>
node
- a nodenode
,
or null
if node
is not a node of the graph represented by
this model.public Collection<? extends V> roots()
roots
in interface RootedGraphModel<V>
see also the complete user documentation .