Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentSkipListMap$Node


  @SuppressWarnings("unchecked")
  public Object visit(ASTTripleSet node, Object data) {
    Item[] item = { null, null, null };

    for(int i = 0; i < 3; i++) {
      Node n = node.jjtGetChild(i);
      item[i] = SPARQLCoreParserVisitorImplementation.getItem(n);
    }

    HashMap<Item, DataRDFTerm> rdfHash = (HashMap<Item, DataRDFTerm>) data;
    DataRDFTerm rdfTermSubject = rdfHash.get(item[0]);
View Full Code Here


    try {
      HashMap<Item, DataRDFTerm> rdfHash = (HashMap<Item, DataRDFTerm>) data;
      LinkedHashSet<Operator> rdfTermToJoin = new LinkedHashSet<Operator>();

      for(int i = 0; i < node.jjtGetNumChildren(); i++) {
        Node n = node.jjtGetChild(i);

        if(n instanceof ASTTripleSet) {
          DataRDFTerm rdft = (DataRDFTerm) n.jjtAccept((SPARQL1_1ParserVisitor) this, rdfHash);

          rdfTermToJoin.add(rdft);
        }
      }
View Full Code Here

    }
  }

  @Override
  public String visit(final ASTFilterConstraint node) {
    final Node n = new SimpleNode(0);
    final Node parent = node.jjtGetParent();
    n.jjtAddChild(node, 0);
    node.jjtSetParent(n);
    parent.replaceChild2(node, n);
    n.jjtSetParent(parent);
    this.applyRules(node);
    String ret = "";
    final String prefix = (parent instanceof ASTOrderConditions || parent instanceof ASTHaving)? "" : "FILTER";
    final String postfix = (parent instanceof ASTOrderConditions || parent instanceof ASTHaving)? "" : ".\n";
    final int numberOfChildren = n.jjtGetNumChildren();
    for (int i = 0; i < numberOfChildren; i++) {
      final Node currentChild=n.jjtGetChild(i);
      for(int j=0; j<currentChild.jjtGetNumChildren();j++){
        ret += prefix + "(" + this.visitChild(currentChild, j) + ")"+postfix;
      }
    }
    return ret;
  }
View Full Code Here

  }

  private int applyRules(final Node node) {
    if (this.rules[FILTER_AND] && node instanceof ASTFilterConstraint
        && node.jjtGetChild(0) instanceof ASTAndNode) {
      final Node parent = node.jjtGetParent();
      if (this.filter_and((ASTFilterConstraint) node)) {
        return this.applyRules(parent);
      }
    }
    if (this.rules[FILTER_OR] && node instanceof ASTAndNode) {
View Full Code Here

  }

  private boolean nestedOr(final ASTAndNode node) {
    final int ind = this.checkNestedOr(node);
    if (ind >= 0) {
      final Node parent = node.jjtGetParent();
      final Node or = node.jjtGetChild(ind).clone(false);
      node.removeChild(ind);
      parent.addChild(or);
      or.addChild(node);
      final ASTAndNode addAnd = (ASTAndNode) node.cloneStillChild(false);
      node.addChild(or.jjtGetChild(0));
      addAnd.addChild(or.jjtGetChild(0));
    }
    return ind >= 0;
  }
View Full Code Here

     * Then the predicate gets visited by teaching him about the curent subject and object
     * The returned expression is stored in the ret String
     * This way the loop will put together all predicates with every element of the correspondending ObjectList
     */
    for (int i = indexStart; i < node.jjtGetNumChildren(); i+=2) {
      final Node currentObjectList =node.jjtGetChild(i+1);
      for(int j = 0; j < currentObjectList.jjtGetNumChildren(); j++){
        final Node currentObject = currentObjectList.jjtGetChild(j);
        if(currentObject instanceof ASTBlankNodePropertyList || currentObject instanceof ASTCollection){
          ret += node.jjtGetChild(i).accept(this, subject, this.getVarOrBlankNode(currentObject)) + "\n";
          ret += this.visitChild(currentObjectList,j);
        } else {
          ret += node.jjtGetChild(i).accept(this, subject, this.visitChild(currentObjectList,j)) + "\n";
View Full Code Here

  }

 
  @Override
  public void insertFederatedQueryOperator(final ASTService node, final OperatorConnection connection){
    Node child0 = node.jjtGetChild(0);
    if (child0 instanceof ASTVar) {
      Join join = new Join();
      connection.connect(join);
      SeveralSucceedingOperators sso = new SeveralSucceedingOperators();
      sso.addSucceedingOperator(join, 0);
View Full Code Here

      while(n.jjtGetParent()!=null && !(n instanceof ASTGraphConstraint)){
        n = n.jjtGetParent();
      }
      String additionalGraphVariable = "";
      if(n instanceof ASTGraphConstraint){
        final Node child0 = n.jjtGetChild(0);
        if(child0 instanceof ASTVar) {
          additionalGraphVariable = " " + ((ASTVar)child0).toQueryString();
        }
      }
      // intermediate Strings are used for the special queries
View Full Code Here

  @Override
  public Object evaluate(final ASTFunctionCall node, final Bindings b, final Map<Node, Object> d) throws TypeErrorException, NotBoundException {
    final Literal name = LazyLiteral.getLiteral(node.jjtGetChild(0));
    final ExternalFunction externalFunction = EvaluationVisitorImplementation.externalFunctions.get(name);
    if(externalFunction!=null){
      final Node child1 = node.jjtGetChild(1);
      final int number = child1.jjtGetNumChildren();
      final Object[] args = new Object[number];
      for(int i=0; i<number; i++){
        args[i] = child1.jjtGetChild(i).accept(this, b, d);
      }
      return externalFunction.evaluate(args);
    }
    if (name.toString().startsWith("<http://www.w3.org/2001/XMLSchema#")) {
      return Helper.cast(name.toString(), this.resultOfChildZero(node.jjtGetChild(1), b, d));
View Full Code Here

      final Map<Node, Object> d) throws NotBoundException, TypeErrorException {
    if (node.jjtGetNumChildren() == 0) {
      return "";
    }
    // jump over ASTExpressionList!
    final Node child0 = node.jjtGetChild(0);
    if (child0 instanceof ASTNIL || child0.jjtGetNumChildren() == 0) {
      return "";
    }
    Object result = Helper.unlazy(child0.jjtGetChild(0).accept(this, b, d));
    if (Helper.isNumeric(result)) {
      return null;
    }
    for (int i = 1; i < child0.jjtGetNumChildren(); i++) {

      final Object child = Helper.unlazy(child0.jjtGetChild(i).accept(this, b, d));

      if (Helper.isNumeric(child)) {
        return null;
      }
View Full Code Here

TOP

Related Classes of java.util.concurrent.ConcurrentSkipListMap$Node

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.