/** * {@inheritDoc} * * TODO Review. I believe that AssignmentNode.getValueExpression() should * always return the Bind(). Right now it only returns the RIGHT argument. * This assumption is build into the GROUP_BY handling in * {@link AST2BOpUtility}. */ @Override public IValueExpressionNode getValueExpressionNode() { return (IValueExpressionNode) get(1); }
(AssignmentNode) groupByNode.get(0); if (assignmentNodeInGroupBy.arity() != 2 || !(assignmentNodeInGroupBy.get(0) instanceof VarNode) || !(assignmentNodeInGroupBy.get(1) instanceof VarNode)) { return; // something's wrong here groupingVar = (VarNode) assignmentNodeInGroupBy.get(1); (VarNode) assignmentNodeInGroupBy.get(0); if (!(curNode.get(0) instanceof VarNode)) { return; // first exp of assignment node is assigned var countNodeVar = (VarNode) curNode.get(0); indexOfCountNode = i;
(AssignmentNode) groupByNode.get(0); if (assignmentNodeInGroupBy.arity() != 2 || !(assignmentNodeInGroupBy.get(0) instanceof VarNode) || !(assignmentNodeInGroupBy.get(1) instanceof VarNode)) { return; // something's wrong here groupingVar = (VarNode) assignmentNodeInGroupBy.get(1); (VarNode) assignmentNodeInGroupBy.get(0); if (!(curNode.get(0) instanceof VarNode)) { return; // first exp of assignment node is assigned var countNodeVar = (VarNode) curNode.get(0); indexOfCountNode = i;
/** * The variable onto which the assignment is bound (as a {@link VarNode}). * * @return For <code>BIND(valueExpr AS ?var)</code> this returns * <code>?var</code> as a {@link VarNode}. */ public VarNode getVarNode() { return (VarNode) get(0); }
/** * The variable onto which the assignment is bound (as a {@link VarNode}). * * @return For <code>BIND(valueExpr AS ?var)</code> this returns * <code>?var</code> as a {@link VarNode}. */ public VarNode getVarNode() { return (VarNode) get(0); }
/** * {@inheritDoc} * * TODO Review. I believe that AssignmentNode.getValueExpression() should * always return the Bind(). Right now it only returns the RIGHT argument. * This assumption is build into the GROUP_BY handling in * {@link AST2BOpUtility}. */ @Override public IValueExpressionNode getValueExpressionNode() { return (IValueExpressionNode) get(1); }
@Override public int replaceAllWith(final BOp oldVal, final BOp newVal) { if (oldVal.equals(get(0)) && !(newVal instanceof VarNode)) { return 0; } return super.replaceAllWith(oldVal, newVal); }
@Override public int replaceAllWith(final BOp oldVal, final BOp newVal) { if (oldVal.equals(get(0)) && !(newVal instanceof VarNode)) { return 0; } return super.replaceAllWith(oldVal, newVal); }