@Override public QueryNode cloneTree() throws CloneNotSupportedException { PhraseSlopQueryNode clone = (PhraseSlopQueryNode) super.cloneTree(); clone.value = this.value; return clone; }
protected boolean isRoot() { return getParent() == null; }
private void setParent(QueryNode parent) { if (this.parent != parent) { this.removeFromParent(); this.parent = parent; } }
@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); }
/** * @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 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); }
/** * @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 QueryNode cloneTree() throws CloneNotSupportedException { SlopQueryNode clone = (SlopQueryNode) super.cloneTree(); clone.value = this.value; return clone; }
private void setParent(QueryNode parent) { if (this.parent != parent) { this.removeFromParent(); this.parent = parent; } }
protected boolean isRoot() { return getParent() == null; }
@Override public FieldQueryNode cloneTree() throws CloneNotSupportedException { FieldQueryNode fqn = (FieldQueryNode) super.cloneTree(); fqn.begin = this.begin; fqn.end = this.end; fqn.field = this.field; fqn.text = this.text; fqn.positionIncrement = this.positionIncrement; fqn.toQueryStringIgnoreFields = this.toQueryStringIgnoreFields; return fqn; }
@Override public RegexpQueryNode cloneTree() throws CloneNotSupportedException { RegexpQueryNode clone = (RegexpQueryNode) super.cloneTree(); clone.field = this.field; clone.text = this.text; return clone; }
@Override public QueryNode cloneTree() throws CloneNotSupportedException { MultiPhraseQueryNode clone = (MultiPhraseQueryNode) super.cloneTree(); // nothing to do return clone; }
@Override public QueryNode cloneTree() throws CloneNotSupportedException { TokenizedPhraseQueryNode clone = (TokenizedPhraseQueryNode) super .cloneTree(); // nothing to do return clone; }
@Override public QueryNode cloneTree() throws CloneNotSupportedException { final NodeBooleanQueryNode clone = (NodeBooleanQueryNode) super.cloneTree(); // nothing to do here return clone; }
@Override public QueryNode cloneTree() throws CloneNotSupportedException { TokenizedPhraseQueryNode clone = (TokenizedPhraseQueryNode) super .cloneTree(); // nothing to do return clone; }