Module org.jhotdraw8.graph
Class ArcBackLinkWithCost<V,A,C extends Number & Comparable<C>>
java.lang.Object
org.jhotdraw8.graph.path.backlink.AbstractBackLink<ArcBackLinkWithCost<V,A,C>>
org.jhotdraw8.graph.path.backlink.AbstractBackLinkWithCost<ArcBackLinkWithCost<V,A,C>,C>
org.jhotdraw8.graph.path.backlink.ArcBackLinkWithCost<V,A,C>
- Type Parameters:
V- the vertex typeA- the arrow typeC- the cost number type
public class ArcBackLinkWithCost<V,A,C extends Number & Comparable<C>>
extends AbstractBackLinkWithCost<ArcBackLinkWithCost<V,A,C>,C>
Represents an arc back link with cost and depth.
-
Field Summary
Fields inherited from class org.jhotdraw8.graph.path.backlink.AbstractBackLink
depth, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArrow()static <VV,AA, CC extends Number & Comparable<CC>, XX>
@Nullable SimpleOrderedPair<ImmutableList<XX>, CC> toArrowSequence(@Nullable ArcBackLinkWithCost<VV, AA, CC> node, @NonNull BiFunction<ArcBackLinkWithCost<VV, AA, CC>, ArcBackLinkWithCost<VV, AA, CC>, XX> mappingFunction) Converts anArcBackLinkWithCostinto an arrow sequence.static <VV,AA, CC extends Number & Comparable<CC>, XX>
@Nullable SimpleOrderedPair<ImmutableList<XX>, CC> toVertexSequence(@Nullable ArcBackLinkWithCost<VV, AA, CC> node, @NonNull Function<ArcBackLinkWithCost<VV, AA, 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
-
ArcBackLinkWithCost
public ArcBackLinkWithCost(@NonNull V vertex, @Nullable A arrow, @Nullable ArcBackLinkWithCost<V, A, C> parent, @NonNull C cost) Creates a new instance.- Parameters:
vertex- the vertex dataarrow- the arrow dataparent- the parent back linkcost- the cumulated cost of this back link. Must be zero if parent is null.
-
-
Method Details
-
toVertexSequence
public static <VV,AA, @Nullable SimpleOrderedPair<ImmutableList<XX>,CC extends Number & Comparable<CC>, XX> CC> toVertexSequence(@Nullable ArcBackLinkWithCost<VV, AA, CC> node, @NonNull Function<ArcBackLinkWithCost<VV, AA, CC>, XX> mappingFunction) Converts anArcBackLinkWithCostinto a vertex sequence.- Type Parameters:
VV- the vertex data typeAA- the arrow data typeCC- the cost number typeXX- the vertex sequence element type- Parameters:
node- theArcBackLinkWithCostmappingFunction- the mapping function- Returns:
- the vertex sequence
-
toArrowSequence
public static <VV,AA, @Nullable SimpleOrderedPair<ImmutableList<XX>,CC extends Number & Comparable<CC>, XX> CC> toArrowSequence(@Nullable ArcBackLinkWithCost<VV, AA, CC> node, @NonNull BiFunction<ArcBackLinkWithCost<VV, AA, CC>, ArcBackLinkWithCost<VV, AA, CC>, XX> mappingFunction) Converts anArcBackLinkWithCostinto an arrow sequence.- Type Parameters:
VV- the vertex data typeAA- the arrow data typeCC- the cost number typeXX- the arrow sequence element type- Parameters:
node- theArcBackLinkWithCostmappingFunction- the mapping function- Returns:
- the arrow sequence
-
getArrow
-
getVertex
-