V
- the vertex type.E
- the edge type.public final class DAGBuilder<V extends Vertex,E extends Edge<V>> extends Object implements Serializable
Constructor and Description |
---|
DAGBuilder()
Constructor of DAGBuilder: it initializes everything.
|
DAGBuilder(DAG<V,E> dag)
Constructor of DAGBuilder with a DAG to start from.
|
Modifier and Type | Method and Description |
---|---|
DAGBuilder<V,E> |
addVertex(V v)
Add vertex to the builder.
|
DAGBuilder<V,E> |
addVertex(V v,
DAG<V,E> dag)
Add vertex to the builder, using the information from the given DAG.
|
DAGBuilder<V,E> |
addVertex(V v,
Stack<LoopVertex> loopVertexStack)
Add vertex to the builder, using the LoopVertex stack.
|
DAG<V,E> |
build()
Build the DAG.
|
DAG<V,E> |
buildWithoutSourceSinkCheck()
Build the DAG for LoopVertex.
|
DAGBuilder<V,E> |
connectVertices(E edge)
Connect vertices at the edge.
|
boolean |
contains(Predicate<V> predicate)
check if the DAGBuilder contains any vertex that satisfies the predicate.
|
boolean |
contains(V vertex)
check if the DAGBuilder contains the vertex.
|
boolean |
isEmpty()
Checks whether the DAGBuilder is empty.
|
DAGBuilder<V,E> |
removeVertex(V v)
Remove the vertex from the list.
|
public DAGBuilder()
public DAGBuilder<V,E> addVertex(V v)
v
- vertex to add.public DAGBuilder<V,E> addVertex(V v, Stack<LoopVertex> loopVertexStack)
v
- vertex to add.loopVertexStack
- LoopVertex stack to retrieve the information from.public DAGBuilder<V,E> addVertex(V v, DAG<V,E> dag)
v
- vertex to add.dag
- DAG to observe and get the LoopVertex-related information from.public DAGBuilder<V,E> removeVertex(V v)
v
- vertex to remove.public DAGBuilder<V,E> connectVertices(E edge)
edge
- edge to add.
Note: the two vertices of the edge should already be added to the DAGBuilder.public boolean isEmpty()
public boolean contains(V vertex)
vertex
- vertex that it searches for.public boolean contains(Predicate<V> predicate)
predicate
- predicate to test each vertices with.public DAG<V,E> buildWithoutSourceSinkCheck()
Copyright © 2018. All rights reserved.