/** * @return a List for QueryNode object. Returns null, for nodes that do not * contain children. All leaf Nodes return null. */ @Override public final List<QueryNode> getChildren() { if (isLeaf() || this.clauses == null) { return null; } return new ArrayList<>(this.clauses); }
/** * @return a List for QueryNode object. Returns null, for nodes that do not * contain children. All leaf Nodes return null. */ @Override public final List<QueryNode> getChildren() { if (isLeaf() || this.clauses == null) { return null; } return new ArrayList<>(this.clauses); }
@Override public final void add(QueryNode child) { if (isLeaf() || this.clauses == null || child == null) { throw new IllegalArgumentException(NLS .getLocalizedMessage(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED)); } this.clauses.add(child); ((QueryNodeImpl) child).setParent(this); }
@Override public final void add(QueryNode child) { if (isLeaf() || this.clauses == null || child == null) { throw new IllegalArgumentException(NLS .getLocalizedMessage(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED)); } this.clauses.add(child); ((QueryNodeImpl) child).setParent(this); }
@Override public final void add(List<QueryNode> children) { if (isLeaf() || this.clauses == null) { throw new IllegalArgumentException(NLS .getLocalizedMessage(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED)); } for (QueryNode child : children) { add(child); } }
@Override public final void add(List<QueryNode> children) { if (isLeaf() || this.clauses == null) { throw new IllegalArgumentException(NLS .getLocalizedMessage(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED)); } for (QueryNode child : children) { add(child); } }
@Override public final void set(List<QueryNode> children) { if (isLeaf() || this.clauses == null) { ResourceBundle bundle = ResourceBundle .getBundle("org.apache.lucene.queryParser.messages.QueryParserMessages"); String message = bundle.getObject("Q0008E.NODE_ACTION_NOT_SUPPORTED") .toString(); throw new IllegalArgumentException(message); } // reset parent value for (QueryNode child : children) { child.removeFromParent(); } ArrayList<QueryNode> existingChildren = new ArrayList<>(getChildren()); for (QueryNode existingChild : existingChildren) { existingChild.removeFromParent(); } // allocate new children list allocate(); // add new children and set parent add(children); }
@Override public final void set(List<QueryNode> children) { if (isLeaf() || this.clauses == null) { ResourceBundle bundle = ResourceBundle .getBundle("org.apache.lucene.queryParser.messages.QueryParserMessages"); String message = bundle.getObject("Q0008E.NODE_ACTION_NOT_SUPPORTED") .toString(); throw new IllegalArgumentException(message); } // reset parent value for (QueryNode child : children) { child.removeFromParent(); } ArrayList<QueryNode> existingChildren = new ArrayList<>(getChildren()); for (QueryNode existingChild : existingChildren) { existingChild.removeFromParent(); } // allocate new children list allocate(); // add new children and set parent add(children); }