Package org.onlab.graph
Class AbstractGraphPathSearch.DefaultResult
- java.lang.Object
-
- org.onlab.graph.AbstractGraphPathSearch.DefaultResult
-
- All Implemented Interfaces:
GraphPathSearch.Result<V,E>
- Direct Known Subclasses:
DepthFirstSearch.SpanningTreeResult
,KShortestPathsSearch.InnerOrderedResult
protected class AbstractGraphPathSearch.DefaultResult extends java.lang.Object implements GraphPathSearch.Result<V,E>
Default path search result that uses the DefaultPath to convey paths in a graph.
-
-
Constructor Summary
Constructors Constructor Description DefaultResult(V src, V dst)
Creates the result of a single-path search.DefaultResult(V src, V dst, int maxPaths)
Creates the result of path search.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildPaths()
Builds a set of paths for the specified src/dst vertex pair.java.util.Map<V,Weight>
costs()
Return a bindings of each vertex to its cost in the path.V
dst()
Returns the search destination, if was was given.java.util.Map<V,java.util.Set<E>>
parents()
Returns bindings of each vertex to its parent edges in the path.java.util.Set<Path<V,E>>
paths()
Returns the set of paths produced as a result of the graph search.V
src()
Returns the search source.
-
-
-
Constructor Detail
-
DefaultResult
public DefaultResult(V src, V dst)
Creates the result of a single-path search.- Parameters:
src
- path sourcedst
- optional path destination
-
DefaultResult
public DefaultResult(V src, V dst, int maxPaths)
Creates the result of path search.- Parameters:
src
- path sourcedst
- optional path destinationmaxPaths
- optional limit of number of paths;GraphPathSearch.ALL_PATHS
if no limit
-
-
Method Detail
-
src
public V src()
Description copied from interface:GraphPathSearch.Result
Returns the search source.
-
dst
public V dst()
Description copied from interface:GraphPathSearch.Result
Returns the search destination, if was was given.
-
paths
public java.util.Set<Path<V,E>> paths()
Description copied from interface:GraphPathSearch.Result
Returns the set of paths produced as a result of the graph search.
-
costs
public java.util.Map<V,Weight> costs()
Description copied from interface:GraphPathSearch.Result
Return a bindings of each vertex to its cost in the path.
-
parents
public java.util.Map<V,java.util.Set<E>> parents()
Description copied from interface:GraphPathSearch.Result
Returns bindings of each vertex to its parent edges in the path.
-
buildPaths
protected void buildPaths()
Builds a set of paths for the specified src/dst vertex pair.
-
-