quarks.graph
Interface Graph
-
- All Known Implementing Classes:
- quarks.graph.spi.AbstractGraph, DirectGraph
public interface Graph
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.util.Collection<Edge>
getEdges()
Return an unmodifiable view of all edges in this graph.java.util.Collection<Vertex<? extends Oplet<?,?>,?,?>>
getVertices()
Return an unmodifiable view of all vertices in this graph.<N extends Oplet<C,P>,C,P>
Vertex<N,C,P>insert(N oplet, int inputs, int outputs)
Add a new unconnectedVertex
into the graph.void
peekAll(Supplier<? extends Peek<?>> supplier, Predicate<Vertex<?,?,?>> select)
Insert Peek oplets returned by the specifiedSupplier
into the outputs of all of the oplets which satisfy the specifiedPredicate
.<N extends Oplet<C,P>,C,P>
Connector<P>pipe(Connector<C> output, N oplet)
<N extends Source<P>,P>
Connector<P>source(N oplet)
-
-
-
Method Detail
-
insert
<N extends Oplet<C,P>,C,P> Vertex<N,C,P> insert(N oplet, int inputs, int outputs)
Add a new unconnectedVertex
into the graph.- Parameters:
oplet
- the oplet to associate with the new vertexinputs
- the number of input connectors for the new vertexoutputs
- the number of output connectors for the new vertex- Returns:
- the newly created
Vertex
for the oplet
-
source
<N extends Source<P>,P> Connector<P> source(N oplet)
Create a new unconnectedVertex
associated with the specified sourceOplet
.The
Vertex
for the oplet has 0 input connectors and one output connector.- Parameters:
oplet
- the source oplet- Returns:
- the output connector for the newly created vertex.
-
pipe
<N extends Oplet<C,P>,C,P> Connector<P> pipe(Connector<C> output, N oplet)
Create a new connectedVertex
associated with the specifiedOplet
.The new
Vertex
has one input and one outputConnector
. AnEdge
is created connecting the specified output connector to the new vertice's input connector.- Parameters:
output
-oplet
- the oplet to associate with the newVertex
- Returns:
- the output connector for the new
Vertex
-
peekAll
void peekAll(Supplier<? extends Peek<?>> supplier, Predicate<Vertex<?,?,?>> select)
Insert Peek oplets returned by the specifiedSupplier
into the outputs of all of the oplets which satisfy the specifiedPredicate
.- Parameters:
supplier
- Function which provides a Peek oplet to insertselect
- Predicate to determine determines whether a Peek oplet will be inserted on the outputs of the vertex passed as parameter
-
getVertices
java.util.Collection<Vertex<? extends Oplet<?,?>,?,?>> getVertices()
Return an unmodifiable view of all vertices in this graph.- Returns:
- unmodifiable view of all vertices in this graph
-
getEdges
java.util.Collection<Edge> getEdges()
Return an unmodifiable view of all edges in this graph.
-
-