Class ModelRelationshipTraversal
java.lang.Object
io.fluxzero.common.modeling.ModelRelationshipTraversal
Shared breadth-first traversal mechanics for temporal model relationships.
Stores remain responsible for selecting relationships at the required boundary and for choosing traversal direction. This class owns frontier progression, visit semantics, graph bounds, edge collection and truncation detection so production and in-memory stores cannot implement those rules independently.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTraversal bounds and the failure messages associated with exceeding them.static interfaceSupplies the relationships for one breadth-first frontier without requiring materialization.static final recordOrdered traversal result, including edges only when an edge mapper was supplied. -
Method Summary
Modifier and TypeMethodDescriptionReturns the first reachable cycle, including its repeated closing node, or an empty list.static <R> ModelRelationshipTraversal.Resulttraverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, ModelRelationshipTraversal.RelationshipLoader<R> relationshipLoader, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper) Traverses one relationship source without extra targets or per-level result handling.static <R> ModelRelationshipTraversal.Resulttraverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, ModelRelationshipTraversal.RelationshipLoader<R> relationshipLoader, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper, Function<Collection<String>, Collection<String>> extraTargetLoader, BiConsumer<Integer, Collection<String>> levelConsumer) Traverses one relationship source with optional extra targets and per-level result handling.static <R> ModelRelationshipTraversal.Resulttraverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, List<ModelRelationshipTraversal.RelationshipLoader<R>> relationshipLoaders, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper, Function<Collection<String>, Collection<String>> extraTargetLoader, BiConsumer<Integer, Collection<String>> levelConsumer) Traverses one or more ordered relationship sources using the supplied storage-specific selectors.
-
Method Details
-
traverse
public static <R> ModelRelationshipTraversal.Result traverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, ModelRelationshipTraversal.RelationshipLoader<R> relationshipLoader, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper) Traverses one relationship source without extra targets or per-level result handling. -
traverse
public static <R> ModelRelationshipTraversal.Result traverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, ModelRelationshipTraversal.RelationshipLoader<R> relationshipLoader, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper, Function<Collection<String>, Collection<String>> extraTargetLoader, BiConsumer<Integer, Collection<String>> levelConsumer) Traverses one relationship source with optional extra targets and per-level result handling. -
traverse
public static <R> ModelRelationshipTraversal.Result traverse(Collection<String> roots, ModelRelationshipTraversal.Policy policy, List<ModelRelationshipTraversal.RelationshipLoader<R>> relationshipLoaders, Function<R, String> targetSelector, Function<R, ModelGraphEdge> edgeMapper, Function<Collection<String>, Collection<String>> extraTargetLoader, BiConsumer<Integer, Collection<String>> levelConsumer) Traverses one or more ordered relationship sources using the supplied storage-specific selectors. -
cycle
-