コード例 #1
0
ファイル: OpRewriter.java プロジェクト: apache/jena
 /**
  * Get the result of the rewrite.
  *
  * @return the resulting operator
  */
 public Op getResult() {
   if (result.size() == 0) {
     return OpNull.create();
   }
   if (result.size() == 1) {
     return result.get(0);
   }
   return result;
 }
コード例 #2
0
ファイル: OpRewriter.java プロジェクト: apache/jena
 /** Rewrite sequence elements */
 @Override
 public void visit(final OpSequence opSequence) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("Starting visiting OpSequence");
   }
   addOp(rewriteOpN(opSequence, OpSequence.create()));
 }
コード例 #3
0
 private static Op flush(BasicPattern pattern, Op op) {
   if (pattern == null || pattern.isEmpty()) {
     if (op == null) return OpTable.unit();
     return op;
   }
   OpBGP opBGP = new OpBGP(pattern);
   return OpSequence.create(op, opBGP);
 }
コード例 #4
0
ファイル: OpRewriter.java プロジェクト: apache/jena
 /**
  * Add the operation to the result.
  *
  * @param op the operation to add.
  */
 private void addOp(final Op op) {
   result.add(op);
 }
コード例 #5
0
ファイル: OpRewriter.java プロジェクト: apache/jena
 /**
  * Reset the rewriter to the initial state.
  *
  * @return this rewriter for chaining.
  */
 public OpRewriter reset() {
   result = OpSequence.create();
   return this;
 }