Packages

class Graph extends AnyRef

A pipeline graph.

This is the fundamental API for constructing pipeline graphs. Once constructed, graphs can be executed with the com.jafpl.runtime.GraphRuntime.

Graphs are initially open, meaning that nodes and edges can be added to them, and !valid, meaning that no attempt has been made to validate them.

When all of the nodes and edges have been added to a graph, the graph is closed and validated by calling the close() method. Only valid graphs can be executed.

Generally speaking, steps are either atomic (in which case you're responsible for providing their implementation) or containers. Each may have an optional label. The labels have no purpose except clarity in error messages and in the graph diagrams. Labels must begin with a letter and may consist of letters, digits, hyphens, and underscores.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Graph
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Graph(jafpl: Jafpl)

    A pipeline graph.

    A pipeline graph.

    Attributes
    protected[com.jafpl]

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 addAtomic(step: Step, label: Option[String]): Node

    Adds an atomic step to the graph.

    Adds an atomic step to the graph.

    step

    The step implementation.

    label

    An optional, user-defined label.

    returns

    The constructed atomic.

    Attributes
    protected[com.jafpl.graph]
  5. def addBindingEdge(from: Binding, to: Node): Unit

    Adds an edge from a variable binding to a step.

    Adds an edge from a variable binding to a step.

    from

    The variable binding.

    to

    The step that should receive the binding.

  6. def addBindingEdge(varname: String, to: Node): Unit

    Adds a binding edge from the in-scope binding for a variable.

    Adds a binding edge from the in-scope binding for a variable.

    varname

    The name of the variable.

    to

    The step that should receive the binding.

  7. def addCatch(label: Option[String], codes: List[Any]): CatchStart
    Attributes
    protected[com.jafpl.graph]
  8. def addChoose(label: Option[String]): ChooseStart

    Adds a choose to the graph.

    Adds a choose to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed choose.

    Attributes
    protected[com.jafpl.graph]
  9. def addDependsEdge(from: Node, to: Node): Unit
    Attributes
    protected[com.jafpl.graph]
  10. def addEdge(from: Node, fromName: String, to: Node, toName: String): Unit

    Adds an edge between two nodes in the graph.

    Adds an edge between two nodes in the graph.

    An edge connects a specific output port on one step to a specific input port on another. Outputs can go to multiple inputs. Inputs can come from multiple outputs. (In the latter case, no guarantees about the order of the arrival of documents is made.)

    The graph does not know what inputs steps expect or what outputs they provide. Any edges are allowed. If the actual edges do not correspond to the edges expected by the steps at runtime, errors or unexpected results may occur.

    The following conditions are errors: 1. Crossing the graphs. Edges must be between nodes in the same graph. 1. Loops. No step may have an input directly or indirectly connected to one of its outputs. 1. Reading through walls. Steps inside a container may read from steps outside the container, but steps outside a container cannot "see" the steps inside a container directly. Instead, the inner steps must provide outputs through their container.

    from

    The source node, the one that will be sending output.

    fromName

    The name of the output port on the source node.

    to

    The destination node, the one that will be receiving input.

    toName

    The name of the input port on the destination node.

  11. def addEmptySource(): EmptySource
    Attributes
    protected[com.jafpl.graph]
  12. def addFinally(label: Option[String]): FinallyStart
    Attributes
    protected[com.jafpl.graph]
  13. def addFor(label: Option[String], countFrom: Long, countTo: Long, countBy: Long, manifold: ManifoldSpecification): LoopForStart

    Adds a for-loop to the graph.

    Adds a for-loop to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed for-each.

    Attributes
    protected[com.jafpl.graph]
  14. def addForEach(label: Option[String], manifold: ManifoldSpecification): LoopEachStart

    Adds a for-each to the graph.

    Adds a for-each to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed for-each.

    Attributes
    protected[com.jafpl.graph]
  15. def addGroup(label: Option[String], manifold: ManifoldSpecification): ContainerStart

    Adds a group to the graph.

    Adds a group to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed group.

    Attributes
    protected[com.jafpl.graph]
  16. def addInput(node: Node, port: String): Unit

    Adds a graph input.

    Adds a graph input.

    Graph inputs are values that must be provided at runtime. They're effectively ports into which data can be poured before the pipeline is run.

    node

    The node that needs the input.

    port

    The port that needs the input.

  17. def addJoiner(mode: JoinMode): Joiner
    Attributes
    protected[com.jafpl.graph]
  18. def addJoiner(): Joiner
    Attributes
    protected[com.jafpl.graph]
  19. def addOption(name: String, expression: Any, staticValue: Option[Any], options: Option[Any]): OptionBinding

    FIXME: WRITE THIS

    FIXME: WRITE THIS

    name

    The option name

    expression

    The default initializer for the option

    staticValue

    The statically computed value for the option

    options

    Any implementation specific options you want to pass

    returns

    The binding

  20. def addOption(name: String, expression: Any, staticValue: Option[Any]): OptionBinding

    FIXME: WRITE THIS

    FIXME: WRITE THIS

    name

    The option name

    expression

    The default initializer for the option

    staticValue

    The statically computed value for the option

    returns

    The binding

  21. def addOption(name: String, expression: Any): OptionBinding

    FIXME: WRITE THIS

    FIXME: WRITE THIS

    name

    The option name

    expression

    The default initializer for the option

    returns

    The binding

  22. def addOrderedEdge(from: Node, fromName: String, to: Node, toName: String): Unit
  23. def addOutput(node: Node, port: String): Unit

    Adds a graph output.

    Adds a graph output.

    Graph outputs are places where pipeline outputs can be poured.

    node

    The node that will produce output.

    port

    The port port on which it will produce.

  24. def addPipeline(label: Option[String], manifold: ManifoldSpecification): PipelineStart

    Adds a pipeline to the graph.

    Adds a pipeline to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed Pipeline object.

  25. def addPipeline(label: String, manifold: ManifoldSpecification): PipelineStart

    Adds a pipeline to the graph.

    Adds a pipeline to the graph.

    label

    A user-defined label.

    returns

    The constructed Pipeline object.

  26. def addPipeline(manifold: ManifoldSpecification): PipelineStart

    Adds a pipeline to the graph.

    Adds a pipeline to the graph.

    returns

    The constructed Pipeline object.

  27. def addPriorityEdge(from: Node, fromName: String, to: Node, toName: String): Unit
  28. def addSink(): Sink
    Attributes
    protected[com.jafpl.graph]
  29. def addSplitter(): Splitter
    Attributes
    protected[com.jafpl.graph]
  30. def addTry(label: Option[String]): TryStart
    Attributes
    protected[com.jafpl.graph]
  31. def addTryCatch(label: Option[String]): TryCatchStart

    Adds a try/catch to the graph.

    Adds a try/catch to the graph.

    label

    An optional, user-defined label.

    returns

    The constructed try/catch.

    Attributes
    protected[com.jafpl.graph]
  32. def addUntil(comparator: ItemComparator, label: Option[String], manifold: ManifoldSpecification): LoopUntilStart

    Adds an until to the graph.

    Adds an until to the graph.

    comparator

    The comparator.

    label

    An optional, user-defined label.

    returns

    The constructed for-each.

    Attributes
    protected[com.jafpl.graph]
  33. def addVariable(name: String, expression: Any, staticValue: Option[Any], options: Option[Any]): Binding
    Attributes
    protected[com.jafpl.graph]
  34. def addViewport(composer: ViewportComposer, label: Option[String]): ViewportStart

    Adds a viewport to the graph.

    Adds a viewport to the graph.

    composer

    The viewport composer.

    label

    An optional, user-defined label.

    returns

    The constructed viewport.

    Attributes
    protected[com.jafpl.graph]
  35. def addWhen(expression: Any, label: Option[String], manifold: ManifoldSpecification): WhenStart
    Attributes
    protected[com.jafpl.graph]
  36. def addWhile(tester: ItemTester, label: Option[String], manifold: ManifoldSpecification): LoopWhileStart

    Adds a while to the graph.

    Adds a while to the graph.

    tester

    The test evaluator.

    label

    An optional, user-defined label.

    returns

    The constructed for-each.

    Attributes
    protected[com.jafpl.graph]
  37. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  38. def asXML: Elem

    Return an XML representation of the graph.

    Return an XML representation of the graph.

    The graph is in the http://jafpl.com/ns/graph namespace. A RELAX NG schema is provided for the grammar. There is also a stylesheet that will transform the graph into an SVG diagram.

    returns

    A <graph> element containing a representation of the graph.

  39. def bindings(node: Node): Set[String]
    Attributes
    protected[com.jafpl]
  40. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def close(): Unit

    Close and validate the graph.

    Close and validate the graph.

    When a graph is closed, all of it's nodes and edges will be validated.

    Closing the graph is transformative. New nodes will be added to the graph to ensure that: - Every output port is connected to a single input port. (Splitters will be added.) - Every input port is connected to a single output port. (Joiners will be added.) - If steps inside a loop read from steps outside a loop, a buffer will be added so that the second and subsequent iterations can (re)read the input.

    If exceptions have occurred (or occur during the validation of the graph, the first such exception will be thrown. (All of the exceptions will be sent to the graph error listener, if there is one.)

    * After a graph is closed, no changes can be made to it. * Only valid graphs can be executed.

  42. def dump(): Unit

    Dump all the graph objects to stdout.

  43. def dumpGraphTransitions: Boolean
  44. def dumpGraphTransitions_=(dump: Boolean): Unit
  45. def edges: List[Edge]
    Attributes
    protected[com.jafpl.graph]
  46. def edgesFrom(node: Node, port: String): List[Edge]
    Attributes
    protected[com.jafpl]
  47. def edgesFrom(node: Node): List[Edge]
    Attributes
    protected[com.jafpl]
  48. def edgesTo(node: Node, port: String): List[Edge]
    Attributes
    protected[com.jafpl]
  49. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  50. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  51. def error(cause: Throwable): Unit
    Attributes
    protected[com.jafpl.graph]
  52. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  53. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  54. def hasEdgeFrom(node: Node, port: String): Boolean
    Attributes
    protected[com.jafpl]
  55. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  56. def inboundPorts(node: Node): Set[String]
    Attributes
    protected[com.jafpl]
  57. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  58. val logger: Logger
    Attributes
    protected[com.jafpl]
  59. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  60. def nodes: List[Node]
    Attributes
    protected[com.jafpl]
  61. final def notify(): Unit
    Definition Classes
    AnyRef
  62. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  63. def outboundPorts(node: Node): Set[String]
    Attributes
    protected[com.jafpl]
  64. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  65. def toString(): String
    Definition Classes
    AnyRef → Any
  66. def valid: Boolean

    True if the graph is known to be valid.

  67. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped