Module org.jhotdraw8.graph
Class IndexedVertexBackLinkWithCost<C extends Number & Comparable<C>>
java.lang.Object
org.jhotdraw8.graph.path.backlink.AbstractBackLink<IndexedVertexBackLinkWithCost<C>>
org.jhotdraw8.graph.path.backlink.AbstractBackLinkWithCost<IndexedVertexBackLinkWithCost<C>,C>
org.jhotdraw8.graph.path.backlink.IndexedVertexBackLinkWithCost<C>
- Type Parameters:
C- the cost number type
public class IndexedVertexBackLinkWithCost<C extends Number & Comparable<C>>
extends AbstractBackLinkWithCost<IndexedVertexBackLinkWithCost<C>,C>
Represents an indexed vertex back link with cost and depth.
-
Field Summary
Fields inherited from class org.jhotdraw8.graph.path.backlink.AbstractBackLink
depth, parent -
Constructor Summary
ConstructorsConstructorDescriptionIndexedVertexBackLinkWithCost(int vertex, @Nullable IndexedVertexBackLinkWithCost<C> parent, @NonNull C cost) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionintstatic <XX,CC extends Number & Comparable<CC>>
@Nullable SimpleOrderedPair<ImmutableList<XX>, CC> toVertexSequence(@Nullable IndexedVertexBackLinkWithCost<CC> node, @NonNull Function<IndexedVertexBackLinkWithCost<CC>, XX> mappingFunction) Converts anArcBackLinkWithCostinto 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
-
IndexedVertexBackLinkWithCost
public IndexedVertexBackLinkWithCost(int vertex, @Nullable IndexedVertexBackLinkWithCost<C> parent, @NonNull C cost) Creates a new instance.- Parameters:
vertex- the vertex indexparent- the parent back linkcost- the cumulated cost of this back link. Must be zero if parent is null.
-
-
Method Details
-
getVertex
public int getVertex() -
toVertexSequence
public static <XX,CC extends Number & Comparable<CC>> @Nullable SimpleOrderedPair<ImmutableList<XX>,CC> toVertexSequence(@Nullable IndexedVertexBackLinkWithCost<CC> node, @NonNull Function<IndexedVertexBackLinkWithCost<CC>, XX> mappingFunction) Converts anArcBackLinkWithCostinto a vertex sequence.- Type Parameters:
XX- the vertex sequence element typeCC- the cost number type- Parameters:
node- theArcBackLinkWithCostmappingFunction- the mapping function- Returns:
- the vertex sequence
-