c

org.codefeedr.pipeline

DirectedAcyclicGraph

final class DirectedAcyclicGraph extends AnyRef

A directed acyclic graph. Every Pipeline is enforced into a DAG, so that data cannot flow in a loop. Stage's are nodes in this graph whereas edges represent data flow using a org.codefeedr.buffer.Buffer.

This class is immutable so that graph can be build in a functional manner:

val dag = new DirectedAcyclicGraph()
  .addNode(nodeOne)
  .addNode(nodeTwo)
  .addEdge(nodeOne, nodeTwo)
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DirectedAcyclicGraph
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DirectedAcyclicGraph(nodes: Vector[AnyRef] = Vector(), edges: Vector[Edge] = Vector())

    nodes

    List of nodes to build the graph from.

    edges

    List of edges to build the graph from.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addEdge(from: AnyRef, to: AnyRef): DirectedAcyclicGraph

    Adds an edge between two nodes in given graph.

    Adds an edge between two nodes in given graph.

    from

    The 'start' node.

    to

    The 'end' node.

    returns

    A new graph with the edge included

    Exceptions thrown

    IllegalArgumentException When either node is not in the graph or when the given edge causes a cycle.

  5. def addNode(node: AnyRef): DirectedAcyclicGraph

    Add given node to the graph.

    Add given node to the graph. Note: Nodes already in the graph will not be added again.

    node

    Node to add.

    returns

    A new graph with the node included.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def canReach(from: AnyRef, to: AnyRef): Boolean

    Check whether there is a path from one node to the other.

    Check whether there is a path from one node to the other.

    from

    The 'from' node.

    to

    The 'to' node.

    returns

    true when there is a path.

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. val edges: Vector[Edge]
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(obj: Any): Boolean

    Equality check for a DAG.

    Equality check for a DAG.

    obj

    Object to compare with.

    returns

    True if equal.

    Definition Classes
    DirectedAcyclicGraph → AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def getChildren(node: AnyRef): Vector[AnyRef]

    Get children of a node.

    Get children of a node.

    node

    Node to get children from.

    returns

    A set with the children of the node. Note: can be the empty set.

  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def getFirstParent(node: AnyRef): Option[AnyRef]

    Get the parent that is designated as first/primary parent.

    Get the parent that is designated as first/primary parent. This is the node which edges is found first.

    node

    Node to get first/primary parent from.

    returns

    The parent node. Note: Optional since the parent can be non-existing.

  16. def getParents(node: AnyRef): Vector[AnyRef]

    Get a parents of a node.

    Get a parents of a node.

    node

    Node to get parents from.

    returns

    A set with the parents of the node. Note: can be the empty set.

  17. def hasAnyEdge(node: AnyRef): Boolean

    Check whether the node has any edge at all.

    Check whether the node has any edge at all.

    node

    The node to check.

    returns

    True when it has more than zero edges.

  18. def hasEdge(from: AnyRef, to: AnyRef): Boolean

    Check whether an edge exists between two nodes.

    Check whether an edge exists between two nodes.

    from

    The 'from' node.

    to

    The 'to' node.

    returns

    True when an edge from 'from' to 'to'.

  19. def hasNode(node: AnyRef): Boolean

    Check whether given node is in the graph.

    Check whether given node is in the graph.

    node

    Node to verify.

    returns

    True if in node is in graph.

  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def isEmpty: Boolean

    Check whether a graph is empty.

    Check whether a graph is empty.

    returns

    True when there are no nodes.

  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isSequential: Boolean

    Check whether the graph is sequential.

    Check whether the graph is sequential.

    Sequential means that there is no node with multiple parents or children. The whole set of nodes is a connected line. An empty graph is also sequential.

    returns

    True when the graph is sequential.

  24. def lastInSequence: Option[AnyRef]

    Find the last node, assuming this graph is sequential.

    Find the last node, assuming this graph is sequential.

    returns

    The last node or None if the graph is not sequential or empty.

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. val nodes: Vector[AnyRef]
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def verify(): Unit

    Verifies the graph.

    Verifies the graph.

    1) InputStages cannot have incoming edges. 2) OutputStages cannot have outgoing edges. 3) The input types of stage must be equal to the output types of its incoming edges.

    Exceptions thrown

    InvalidPipelineException if the pipeline is invalid (invalid edges).

    StageTypesIncompatibleException if types within the pipeline are invalid.

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. def withoutOrphans: DirectedAcyclicGraph

    Get a copy of the graph with all orphans removed.

    Get a copy of the graph with all orphans removed. Orphans are nodes without edges.

    returns

    The graph without orphan nodes.

Inherited from AnyRef

Inherited from Any

Ungrouped