Package lupos.engine.operators

Examples of lupos.engine.operators.SimpleOperatorGraphVisitor


public class RulePackageWithStartNodeMap extends AbstractRulePackage {
  private RulePackageWithStartNodeMap that = this;
  private HashMap<Class<?>, HashSet<BasicOperator>> startNodes = new HashMap<Class<?>, HashSet<BasicOperator>>();

  public void applyRules(BasicOperator rootOp) {
    rootOp.visit(new SimpleOperatorGraphVisitor() {
      private static final long serialVersionUID = 8365441598651188658L;

      public Object visit(BasicOperator op) {
        that.classifyNode(op);
View Full Code Here


  }

  public List<DebugContainer<BasicOperatorByteArray>> applyRulesDebugByteArray(BasicOperator rootOp, Prefix prefixInstance) {
    List<DebugContainer<BasicOperatorByteArray>> debug = new LinkedList<DebugContainer<BasicOperatorByteArray>>();

    rootOp.visit(new SimpleOperatorGraphVisitor() {
      private static final long serialVersionUID = 8365441598651188658L;

      public Object visit(BasicOperator op) {
        that.classifyNode(op);
View Full Code Here

  }

  public boolean apply(BasicOperator rootOp) {
    System.out.println("applying rule '" + this.getClass().getSimpleName() + "'...");

    Object result = rootOp.visitAndStop(new SimpleOperatorGraphVisitor() {
      private static final long serialVersionUID = 8365441598651188658L;

      public Object visit(BasicOperator op) {
        if(that.check(op)) {
          that.replace(null);
View Full Code Here

  public Message preProcessMessage(final BoundVariablesMessage msg) {
    final BoundVariablesMessage newMsg = new BoundVariablesMessage(msg);
    //Send Message through the subgraph container graph
    this.getRootOfSubgraph().sendMessage(new BoundVariablesMessage());
    // Search for "result"-node
    final Result result = (Result) this.getRootOfSubgraph().visitAndStop(new SimpleOperatorGraphVisitor(){
      @Override
      public Object visit(final BasicOperator basicOperator) {
        if(basicOperator instanceof Result) {
          return basicOperator;
        } else {
View Full Code Here

  }

  @SuppressWarnings("serial")
  public static Set<Variable> getAllVariablesOfQuery(final BasicOperator rootNode) {
    final Set<Variable> maxVariables = new TreeSet<Variable>();
    rootNode.visit(new SimpleOperatorGraphVisitor() {
      @Override
      public Object visit(final BasicOperator basicOperator) {
        if (basicOperator.getUnionVariables() != null) {
          maxVariables.addAll(basicOperator.getUnionVariables());
        }
View Full Code Here

                prefixInstance)));
        // mapStartNodes = RuleEngine.createStartNodeMap(op);
        if (checkNodeMap) {
          // check if all nodes of the operatorgraph are in the
          // map:
          op.visit(new SimpleOperatorGraphVisitor() {
            public Object visit(final BasicOperator basicOperator) {
              if (!checkIfInNodeMap(basicOperator, mapStartNodes))
                System.err
                .println("The following node is not in mapStartNodes:"
                    + basicOperator);
View Full Code Here

  private static Map<Class<? extends BasicOperator>, Set<BasicOperator>> createStartNodeMap(
      final BasicOperator op) {
    final Map<Class<? extends BasicOperator>, Set<BasicOperator>> mapStartNodes = new HashMap<Class<? extends BasicOperator>, Set<BasicOperator>>();

    op.visit(new SimpleOperatorGraphVisitor() {

      public Object visit(final BasicOperator basicOperator) {
        RuleEngine.addToNodeMap(basicOperator, mapStartNodes);
        return null;
      }
View Full Code Here

          precFilter.addSucceedingOperator(new OperatorIDTuple(oid
              .getOperator(), oid.getId()));
        }
      }
    } else {
      filter.visit(new SimpleOperatorGraphVisitor() {
        boolean ignore = false;

        public Object visit(final BasicOperator basicOperator) {
          if (ignore || (basicOperator instanceof PatternMatcher)
              || (basicOperator instanceof Union))
View Full Code Here

public class RulePackageWithStartNodeMap extends AbstractRulePackage {
  private RulePackageWithStartNodeMap that = this;
  private HashMap<Class<?>, HashSet<BasicOperator>> startNodes = new HashMap<Class<?>, HashSet<BasicOperator>>();

  public void applyRules(BasicOperator rootOp) {
    rootOp.visit(new SimpleOperatorGraphVisitor() {
      private static final long serialVersionUID = 8365441598651188658L;

      public Object visit(BasicOperator op) {
        that.classifyNode(op);
View Full Code Here

  }

  public List<DebugContainer<BasicOperatorByteArray>> applyRulesDebugByteArray(BasicOperator rootOp, Prefix prefixInstance) {
    List<DebugContainer<BasicOperatorByteArray>> debug = new LinkedList<DebugContainer<BasicOperatorByteArray>>();

    rootOp.visit(new SimpleOperatorGraphVisitor() {
      private static final long serialVersionUID = 8365441598651188658L;

      public Object visit(BasicOperator op) {
        that.classifyNode(op);
View Full Code Here

TOP

Related Classes of lupos.engine.operators.SimpleOperatorGraphVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.