Package com.luciad.network.graph.route
Class TLcdRouteUtil
java.lang.Object
com.luciad.network.graph.route.TLcdRouteUtil
Util class offering a set of methods for basic analysis of
ILcdRoute
objects.- Since:
- 5.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic <N,
E> double computeValue
(ILcdRoute<N, E> aRoute, ILcdGraph<N, E> aGraph, ILcdRoute<N, E> aPrecedingRoute, ILcdEdgeValueFunction<N, E> aEdgeValueFunction) Returns the total value of the given route, which is calculated by calculating the values of each edge in the route with the givenILcdEdgeValueFunction
and adding them.static <N,
E> boolean isFullyContainedInGraph
(ILcdRoute<N, E> aRoute, ILcdGraph<N, E> aGraph) Returns true if the given route is fully contained in the given graph, false otherwise.static <N,
E> boolean isPartlyContainedInGraph
(ILcdRoute<N, E> aRoute, ILcdGraph<N, E> aGraph) Returns true if the given route is partly contained in the given graph, false otherwise.
-
Method Details
-
computeValue
public static <N,E> double computeValue(ILcdRoute<N, E> aRoute, ILcdGraph<N, E> aGraph, ILcdRoute<N, E> aPrecedingRoute, ILcdEdgeValueFunction<N, E> aEdgeValueFunction) Returns the total value of the given route, which is calculated by calculating the values of each edge in the route with the givenILcdEdgeValueFunction
and adding them.- Parameters:
aRoute
- the route whose value is to be calculated.aGraph
- the graph in which the route is contained.aPrecedingRoute
- the route that precedes the route whose value is to be computed.aEdgeValueFunction
- the edge value function which is used to evaluate the edges of the route.- Returns:
- the total value of the given route.
- Throws:
NullPointerException
- if aEdgeValueFunction isnull
.
-
isFullyContainedInGraph
Returns true if the given route is fully contained in the given graph, false otherwise. A route is fully contained in a graph if and only if all of its edges and nodes are contained in that graph (the latter follows from the former, since the ILcdGraph invariants state that if a edge is contained in a graph, both of its connected nodes should be too).- Parameters:
aRoute
- the route to be checked.aGraph
- the graph in which the route should be contained.- Returns:
true
if the route is fully contained in the graph,false
otherwise.- Throws:
NullPointerException
- if one of the arguments isnull
.
-
isPartlyContainedInGraph
Returns true if the given route is partly contained in the given graph, false otherwise. A route is partly contained in a graph if and only if at least one of its nodes is part of that graph (and thus at least one (boundary) edge is contained in/connected to that graph).- Parameters:
aRoute
- the route to be checked.aGraph
- the graph in which the route should be contained.- Returns:
true
if the route is partly contained in the graph,false
otherwise.- Throws:
NullPointerException
- if one of the arguments isnull
.
-