Class OpenModelSink<T>

Type Parameters:
T - the model type
All Implemented Interfaces:
PropertyValued, LogicalOperator, OperatorComposable, SinkOperator<AbstractModelPort<T>>

public final class OpenModelSink<T> extends CompositeOperator implements SinkOperator<AbstractModelPort<T>>
A model sink that can be externally composed. This is a convenient way to create a grouping of nodes without needing to subclass CompositeOperator.
  • Constructor Details

    • OpenModelSink

      public OpenModelSink(LogicalPortFactory<? extends AbstractModelPort<T>> portFactory)
      Create a model sink for the given model port type. Following construction, callers must create the body by calling add and connect.
      Parameters:
      portFactory - the factory for the model port, determines the port type
  • Method Details

    • getInput

      public AbstractModelPort<T> getInput()
      Description copied from interface: SinkOperator
      Returns the input port
      Specified by:
      getInput in interface SinkOperator<T>
      Returns:
      the input port
    • connectInput

      public void connectInput(AbstractModelPort<T> to)
    • compose

      protected final void compose(CompositionContext ctx)
      This implementation of compose adds any operators were added to this to the provided composition context and creates any connections that were added to this in the provided composition context.
      Specified by:
      compose in class CompositeOperator
      Parameters:
      ctx - the context
    • add

      public final <O extends LogicalOperator> O add(O op)
      Description copied from interface: OperatorComposable
      Add a LogicalOperator to this graph, using the short class name as the name of the operator.
      Specified by:
      add in interface OperatorComposable
      Type Parameters:
      O - the type of the operator.
      Parameters:
      op - the operator to add to the graph.
      Returns:
      the same operator that was passed to this method
    • add

      public final <O extends LogicalOperator> O add(O op, String name)
      Description copied from interface: OperatorComposable
      Add a LogicalOperator to this graph, specifying a name of the operator.
      Specified by:
      add in interface OperatorComposable
      Type Parameters:
      O - the type of the operator.
      Parameters:
      op - the operator to add to the graph.
      name - the name of the the operator
      Returns:
      the same operator that was passed to this method
    • add

      public final <O extends LogicalOperator> O add(O op, OperatorSettings settings)
      Description copied from interface: OperatorComposable
      Add a LogicalOperator to this graph, specifying advanced operator settings.
      Specified by:
      add in interface OperatorComposable
      Type Parameters:
      O - the type of the operator.
      Parameters:
      op - the operator to add to the graph.
      settings - operators settings, contains name and other configuration options.
      Returns:
      the same operator that was passed to this method
    • connect

      public final void connect(LogicalPort from, LogicalPort to)
      Description copied from interface: OperatorComposable
      Connect two ports together. Depending in the specific context, the source and target operators may be one of the following pairs:
      1. From an output port of an operator that was added to this context to an input port of an operator that was added to this context
      2. From an input port of the CompositeOperator to an input port of an operator that was added to this context. (Applies to CompositeOperator.compose(com.pervasive.datarush.operators.CompositionContext)).
      3. From an output port of an operator that was added to this context to an output port of the CompositeOperator. (Applies to CompositeOperator.compose(com.pervasive.datarush.operators.CompositionContext)).

      Note on port types: connecting mixed type ports will generally fail when the graph is compiled.

      Note that ports do not store connection information; rather, connection information is stored externally within this context.

      Specified by:
      connect in interface OperatorComposable
      Parameters:
      from - the source port
      to - the target port
    • getProperty

      public final Object getProperty(GraphPath path)
      Description copied from interface: PropertyValued
      Returns a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.
      Specified by:
      getProperty in interface PropertyValued
      Parameters:
      path - the path to the property.
      Returns:
      the value of the property
    • setProperty

      public final void setProperty(GraphPath path, Object value)
      Description copied from interface: PropertyValued
      Sets a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.
      Specified by:
      setProperty in interface PropertyValued
      Parameters:
      path - the path to the property.
      value - the new value of the property
    • getProperty

      public final Object getProperty(String path)
      Description copied from interface: PropertyValued
      Returns a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.
      Specified by:
      getProperty in interface PropertyValued
      Parameters:
      path - the path to the property.
      Returns:
      the value of the property
    • setProperty

      public final void setProperty(String path, Object value)
      Description copied from interface: PropertyValued
      Sets a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.
      Specified by:
      setProperty in interface PropertyValued
      Parameters:
      path - the path to the property.
      value - the new value of the property