A - The type of a Node's IDN - The concrete type of a NodeE - The concrete type of an EdgeI - The concrete type of an Iterable of edgesG - Unification type for the concrete Graph implementationpublic interface Graph<A,N extends Node<A>,E extends Edge<A,N,E>,I extends Iterable<E>,G extends Graph<A,N,E,I,G>>
| Modifier and Type | Method and Description |
|---|---|
default Fn1<E,G> |
addEdge() |
G |
addEdge(E edge) |
default Fn1<N,G> |
addNode() |
G |
addNode(N node) |
default Fn1<N,Choice2<G,Tuple2<Context<A,N,E,I>,G>>> |
atNode() |
Choice2<G,Tuple2<Context<A,N,E,I>,G>> |
atNode(N node)
|
Maybe<Tuple2<Context<A,N,E,I>,G>> |
decompose()
Implementation-dependent and possibly non-deterministic decomposition of a graph into a
Context
and the rest of the graph |
default <S,Acc> Acc |
guidedCutFold(Fn1<Context<A,N,E,I>,Boolean> destinationCheck,
State<S,FoldContinue<N>> contextGetter,
Fn2<Acc,Context<A,N,E,I>,State<S,Acc>> accumulator,
S defState,
Acc defAcc)
Fold a graph into an accumulation, using stateful methods to guide the traversal of the graph, and a cutoff
function to end the fold early
|
default <S,Acc> Acc |
guidedFold(State<S,FoldContinue<N>> contextGetter,
Fn2<Acc,Context<A,N,E,I>,State<S,Acc>> accumulator,
S defState,
Acc defAcc)
Fold a graph into an accumulation, using stateful methods to guide the traversal of the graph.
|
Boolean |
isEmpty() |
default Fn1<E,G> |
removeEdge() |
G |
removeEdge(E edge) |
default Fn1<N,G> |
removeNode() |
G |
removeNode(N node) |
default <Acc> Acc |
simpleCutFold(Fn1<Context<A,N,E,I>,Boolean> destinationCheck,
Fn2<Acc,Context<A,N,E,I>,Acc> accumulator,
Acc defAcc)
Fold a graph into an accumulation, using the implementation's
decompose() method, and a cutoff
function to end the fold early |
default <Acc> Acc |
simpleFold(Fn2<Acc,Context<A,N,E,I>,Acc> accumulator,
Acc defAcc)
Fold a graph into an accumulation, using the implementation's
decompose() method. |
Boolean isEmpty()
G removeEdge(E edge)
edge - Edge to remove from graphG with edge removedG addNode(N node)
node - Node to add to graphG with disconnected node addedG removeNode(N node)
node - Node to remove from graphG with node and all connected edges removedMaybe<Tuple2<Context<A,N,E,I>,G>> decompose()
Context
and the rest of the graphChoice2<G,Tuple2<Context<A,N,E,I>,G>> atNode(N node)
node - Node to find in the graph, around which to base a decompositionG if the node cannot be found, or a decomposition into a context
centered on node and the rest of the graphdefault <S,Acc> Acc guidedCutFold(Fn1<Context<A,N,E,I>,Boolean> destinationCheck, State<S,FoldContinue<N>> contextGetter, Fn2<Acc,Context<A,N,E,I>,State<S,Acc>> accumulator, S defState, Acc defAcc)
S - Type of the State updated in the foldAcc - Type of the accumulator returned from the folddestinationCheck - End the fold if a Context matches this predicatecontextGetter - Retrieve the next Node from a given State S. If the state
can't produce a new node, a FoldContinue determines whether the fold should
decompose arbitrarily or end.accumulator - Stateful function to update the accumulator based on the new Context and the StatedefState - Starting State SdefAcc - Starting accumulator Accdefault <S,Acc> Acc guidedFold(State<S,FoldContinue<N>> contextGetter, Fn2<Acc,Context<A,N,E,I>,State<S,Acc>> accumulator, S defState, Acc defAcc)
S - Type of the State updated in the foldAcc - Type of the accumulator returned from the foldcontextGetter - Retrieve the next Node from a given State S. If the state
can't produce a new node, a FoldContinue determines whether the fold should
decompose arbitrarily or end.accumulator - Stateful function to update the accumulator based on the new Context and the StatedefState - Starting State SdefAcc - Starting accumulator Accdefault <Acc> Acc simpleCutFold(Fn1<Context<A,N,E,I>,Boolean> destinationCheck, Fn2<Acc,Context<A,N,E,I>,Acc> accumulator, Acc defAcc)
decompose() method, and a cutoff
function to end the fold earlyAcc - Type of the accumulator returned from the folddestinationCheck - End the fold if a Context matches this predicateaccumulator - Function to update the accumulator based on the new ContextdefAcc - Starting accumulator Accdefault <Acc> Acc simpleFold(Fn2<Acc,Context<A,N,E,I>,Acc> accumulator, Acc defAcc)
decompose() method. Traverses the entire graph.Acc - Type of the accumulator returned from the foldaccumulator - Function to update the accumulator based on the new ContextdefAcc - Starting accumulator AccCopyright © 2020. All Rights Reserved.