public class DAG extends Object implements com.hazelcast.nio.serialization.DataSerializable
Direct acyclic graph representation
DAG describes topology of calculation flow
Vertex1 -> Vertex2 -> Vertex3
-> Vertex4
Data will be passed from vertex to vertex
| Constructor and Description |
|---|
DAG()
Empty constructor
|
DAG(String name)
Create a DAG with a given name
|
| Modifier and Type | Method and Description |
|---|---|
DAG |
addEdge(Edge edge)
Add edge to dag
|
DAG |
addVertex(Vertex vertex) |
boolean |
containsEdge(Edge edge) |
boolean |
containsVertex(Vertex vertex) |
String |
getName() |
Iterator<Vertex> |
getRevertedTopologicalVertexIterator() |
Iterator<Vertex> |
getTopologicalVertexIterator() |
Vertex |
getVertex(String vertexName)
Return vertex with corresponding name
|
Collection<Vertex> |
getVertices() |
void |
readData(com.hazelcast.nio.ObjectDataInput in) |
void |
validate()
Validate DAG's consistency
|
void |
writeData(com.hazelcast.nio.ObjectDataOutput out) |
public DAG()
public DAG(String name)
name - name of the DAGpublic DAG addVertex(Vertex vertex)
vertex - vertex to add to the DAGpublic Vertex getVertex(String vertexName)
vertexName - name of the vertexpublic Collection<Vertex> getVertices()
public String getName()
public boolean containsVertex(Vertex vertex)
vertex - some vertexpublic boolean containsEdge(Edge edge)
edge - some edgepublic Iterator<Vertex> getTopologicalVertexIterator()
public Iterator<Vertex> getRevertedTopologicalVertexIterator()
public void validate()
throws IllegalStateException
Validate DAG's consistency
It checks:
duplicate of vertices names
duplicate of edges names
absence of loops on DAG
IllegalStateException - if DAG validation failspublic DAG addEdge(Edge edge)
edge - corresponding edgepublic void writeData(com.hazelcast.nio.ObjectDataOutput out)
throws IOException
writeData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionpublic void readData(com.hazelcast.nio.ObjectDataInput in)
throws IOException
readData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.