Example #1
0
 /**
  * This is a helper method of the method Object visit(SimpleOperatorGraphVisitor visitor)
  *
  * @param visitor The visitor to be applied to each node
  * @param hs the already visited operators
  * @return The object retrieved from processing the visitor on this operator.
  */
 private Object visit(final SimpleOperatorGraphVisitor visitor, final HashSet<BasicOperator> hs) {
   if (hs.contains(this)) return null;
   hs.add(this);
   final Object result = visitor.visit(this);
   for (final OperatorIDTuple opid : this.succeedingOperators) {
     opid.getOperator().visit(visitor, hs);
   }
   return result;
 }
Example #2
0
  /**
   * This is a helper method of the method Object visit(SimpleOperatorGraphVisitor visitor)
   *
   * @param visitor The visitor to be applied to each node
   * @param hs the already visited operators
   * @return The object retrieved from processing the visitor on this operator.
   */
  private Object visitAndStop(
      final SimpleOperatorGraphVisitor visitor, final HashSet<BasicOperator> hs) {
    if (hs.contains(this)) {
      return null;
    }

    hs.add(this);

    Object result = visitor.visit(this);

    if (result != null) {
      return result;
    }

    for (final OperatorIDTuple opid : this.succeedingOperators) {
      result = opid.getOperator().visitAndStop(visitor, hs);

      if (result != null) {
        return result;
      }
    }

    return result;
  }