/** * Strengthen return type. */ @Override public TermNode get(final int i) { return (TermNode) super.get(i); }
@Override public TermNode getContext() { final IQueryNode parent = getParent(); if (parent instanceof GroupMemberNodeBase<?>) { /* * Recursion up to the parent context. * * TODO It would seem better to explicitly recurse until we find the * first JoinGroup parent, and to define a getJoinGroup() method for * that. */ return ((GroupMemberNodeBase<?>) parent).getContext(); } return null; }
/** * Return the (optional) edge var. */ public VarNode edgeVar() { return (VarNode) super.getProperty(Annotations.EDGE_VAR); }
for (@SuppressWarnings("rawtypes") GroupMemberNodeBase child : subgroup.getChildren(GroupMemberNodeBase.class)) { if (!child.getQueryHintAsBoolean(PATH_EXPR, false)) { child.setQueryHints(new Properties()); subgroup.removeChild(child); if (bidirectional) { group1.addChild((IGroupMemberNode) child.clone()); group2.addChild((IGroupMemberNode) child.clone()); } else { alpNode.subgroup().addChild(child);
/** * Return the lower bound. */ public long lowerBound() { return (Long) super.getRequiredProperty(Annotations.LOWER_BOUND); }
@Override @SuppressWarnings("unchecked") public GraphPatternGroup<IGroupMemberNode> getParentGraphPatternGroup() { IGroupNode<?> parent = getParent(); while (parent != null) { if (parent instanceof GraphPatternGroup) return (GraphPatternGroup<IGroupMemberNode>) parent; parent = parent.getParent(); } return null; }
/** * {@inheritDoc} * <p> * Overridden to set the parent reference on the child */ @SuppressWarnings("unchecked") @Override public void addArg(final int index, final BOp newArg) { super.addArg(index, newArg); ((E) newArg).setParent((IGroupNode<IGroupMemberNode>) this); }
public TermNode getContext() { final IQueryNode parent = getParent(); if (parent instanceof GroupMemberNodeBase<?>) { return ((GroupMemberNodeBase<?>) parent).getContext(); } return null; }
/** * {@inheritDoc} * <p> * Overridden to clear the parent reference on the child. */ @SuppressWarnings("unchecked") @Override public boolean removeArg(final BOp child) { if (super.removeArg(child)) { ((E) child).setParent(null); return true; } return false; }
/** * {@inheritDoc} * <p> * Overridden to also clone the children and then set the parent reference * on the cloned children. */ @Override public GroupNodeBase<E> clone() { @SuppressWarnings("unchecked") final GroupNodeBase<E> tmp = (GroupNodeBase<E>) super.clone(); final int size = size(); for (int i = 0; i < size; i++) { IGroupMemberNode aChild = (IGroupMemberNode) tmp.get(i); aChild = (IGroupMemberNode) ((ASTBase) aChild).clone(); tmp.setArg(i, (ASTBase) aChild); } return tmp; }
/** * {@inheritDoc} * <p> * Overridden to set the parent reference on the new child and clear the * parent reference on the old child. */ @SuppressWarnings("unchecked") @Override public int replaceWith(final BOp oldChild, final BOp newChild) { final int i = super.replaceWith(oldChild, newChild); if (i > 0) { if (((E) oldChild).getParent() == this) { ((E) oldChild).setParent(null); } ((E) newChild).setParent((IGroupNode<IGroupMemberNode>) this); } return i; }
for (@SuppressWarnings("rawtypes") GroupMemberNodeBase child : subgroup.getChildren(GroupMemberNodeBase.class)) { if (!child.getQueryHintAsBoolean(PATH_EXPR, false)) { child.setQueryHints(new Properties()); subgroup.removeChild(child); if (bidirectional) { group1.addChild((IGroupMemberNode) child.clone()); group2.addChild((IGroupMemberNode) child.clone()); } else { alpNode.subgroup().addChild(child);
/** * Returns the left term. */ public TermNode left() { return (TermNode) super.getRequiredProperty(Annotations.LEFT); }
@Override public JoinGroupNode getParentJoinGroup() { IGroupNode<?> parent = getParent(); while (parent != null) { if (parent instanceof JoinGroupNode) return (JoinGroupNode) parent; parent = parent.getParent(); } return null; }
/** * {@inheritDoc} * <p> * Overridden to set the parent reference on the child */ @SuppressWarnings("unchecked") @Override public void addArg(final BOp newArg) { super.addArg(newArg); ((E) newArg).setParent((IGroupNode<IGroupMemberNode>) this); }
public TermNode getContext() { final IQueryNode parent = getParent(); if (parent instanceof GroupMemberNodeBase<?>) { return ((GroupMemberNodeBase<?>) parent).getContext(); } return null; }
/** * {@inheritDoc} * <p> * Overridden to clear the parent reference on the child. */ @SuppressWarnings("unchecked") @Override public boolean removeArg(final BOp child) { if (super.removeArg(child)) { ((E) child).setParent(null); return true; } return false; }
/** * {@inheritDoc} * <p> * Overridden to also clone the children and then set the parent reference * on the cloned children. */ @Override public GroupNodeBase<E> clone() { @SuppressWarnings("unchecked") final GroupNodeBase<E> tmp = (GroupNodeBase<E>) super.clone(); final int size = size(); for (int i = 0; i < size; i++) { IGroupMemberNode aChild = (IGroupMemberNode) tmp.get(i); aChild = (IGroupMemberNode) ((ASTBase) aChild).clone(); tmp.setArg(i, (ASTBase) aChild); } return tmp; }
/** * {@inheritDoc} * <p> * Overridden to set the parent reference on the new child and clear the * parent reference on the old child. */ @SuppressWarnings("unchecked") @Override public int replaceWith(final BOp oldChild, final BOp newChild) { final int i = super.replaceWith(oldChild, newChild); if (i > 0) { if (((E) oldChild).getParent() == this) { ((E) oldChild).setParent(null); } ((E) newChild).setParent((IGroupNode<IGroupMemberNode>) this); } return i; }
/** * Returns the left term. */ public TermNode left() { return (TermNode) super.getRequiredProperty(Annotations.LEFT_TERM); }