Module org.jhotdraw8.graph
Class VertexBackLinkWithCost<V,C extends Number & Comparable<C>>
java.lang.Object
org.jhotdraw8.graph.path.backlink.AbstractBackLink<VertexBackLinkWithCost<V,C>>
org.jhotdraw8.graph.path.backlink.AbstractBackLinkWithCost<VertexBackLinkWithCost<V,C>,C>
org.jhotdraw8.graph.path.backlink.VertexBackLinkWithCost<V,C>
- Type Parameters:
V- the vertex data typeC- the cost number type
public class VertexBackLinkWithCost<V,C extends Number & Comparable<C>>
extends AbstractBackLinkWithCost<VertexBackLinkWithCost<V,C>,C>
Represents a vertex back link with cost and depth.
-
Field Summary
Fields inherited from class org.jhotdraw8.graph.path.backlink.AbstractBackLink
depth, parent -
Constructor Summary
ConstructorsConstructorDescriptionVertexBackLinkWithCost(@NonNull V vertex, @Nullable VertexBackLinkWithCost<V, C> parent, @NonNull C cost) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic <VV,CC extends Number & Comparable<CC>, XX>
@Nullable SimpleOrderedPair<ImmutableList<XX>, CC> toVertexSequence(@Nullable VertexBackLinkWithCost<VV, CC> node, @NonNull Function<VertexBackLinkWithCost<VV, CC>, XX> mappingFunction) Converts anVertexBackLinkWithCostinto a vertex sequence.Methods inherited from class org.jhotdraw8.graph.path.backlink.AbstractBackLinkWithCost
getCostMethods inherited from class org.jhotdraw8.graph.path.backlink.AbstractBackLink
getDepth, getParent
-
Constructor Details
-
VertexBackLinkWithCost
public VertexBackLinkWithCost(@NonNull V vertex, @Nullable VertexBackLinkWithCost<V, C> parent, @NonNull C cost) Creates a new instance.- Parameters:
vertex- the vertex dataparent- the parent back linkcost- the cumulated cost of this back link. Must be zero if parent is null.
-
-
Method Details
-
getVertex
-
toVertexSequence
public static <VV,CC extends Number & Comparable<CC>, @Nullable SimpleOrderedPair<ImmutableList<XX>,XX> CC> toVertexSequence(@Nullable VertexBackLinkWithCost<VV, CC> node, @NonNull Function<VertexBackLinkWithCost<VV, CC>, XX> mappingFunction) Converts anVertexBackLinkWithCostinto a vertex sequence.- Type Parameters:
VV- the vertex data typeCC- the cost number typeXX- the vertex sequence element type- Parameters:
node- theVertexBackLinkWithCostmappingFunction- the mapping function- Returns:
- the vertex sequence
-