/** * Returns the lower bound node. * * @return the lower bound node. */ @Override @SuppressWarnings("unchecked") public T getLowerBound() { return (T) getChildren().get(0); }
@Override public String toString() { StringBuilder sb = new StringBuilder("<").append(getClass().getCanonicalName()); sb.append(" lowerInclusive=").append(isLowerInclusive()); sb.append(" upperInclusive=").append(isUpperInclusive()); sb.append(">\n\t"); sb.append(getUpperBound()).append("\n\t"); sb.append(getLowerBound()).append("\n"); sb.append("</").append(getClass().getCanonicalName()).append(">\n"); return sb.toString(); }
/** * Sets the field associated with this node. * * @param fieldName the field associated with this node */ @Override public void setField(CharSequence fieldName) { T lower = getLowerBound(); T upper = getUpperBound(); if (lower != null) { lower.setField(fieldName); } if (upper != null) { upper.setField(fieldName); } }
/** * Constructs a {@link NodeNumericRangeQueryNode} object using the given * {@link NumericQueryNode} as its bounds and a {@link NumericAnalyzer}. * * @param lower the lower bound * @param upper the upper bound * @param lowerInclusive <code>true</code> if the lower bound is inclusive, otherwise, <code>false</code> * @param upperInclusive <code>true</code> if the upper bound is inclusive, otherwise, <code>false</code> * @param numericAnalyzer the {@link NumericAnalyzer} associated with the upper and lower bounds */ public NodeNumericRangeQueryNode(final NumericQueryNode lower, final NumericQueryNode upper, final boolean lowerInclusive, final boolean upperInclusive, final NumericAnalyzer numericAnalyzer) throws QueryNodeException { if (numericAnalyzer == null) { throw new IllegalArgumentException("numericAnalyzer cannot be null!"); } super.setBounds(lower, upper, lowerInclusive, upperInclusive); this.numericAnalyzer = numericAnalyzer; this.numericType = numericAnalyzer.getNumericParser().getNumericType(); }
children.add(upper); set(children);
/** * Sets the field associated with this node. * * @param fieldName the field associated with this node */ @Override public void setField(CharSequence fieldName) { T lower = getLowerBound(); T upper = getUpperBound(); if (lower != null) { lower.setField(fieldName); } if (upper != null) { upper.setField(fieldName); } }
/** * Constructs a {@link NodeNumericRangeQueryNode} object using the given * {@link NumericQueryNode} as its bounds and a {@link NumericAnalyzer}. * * @param lower the lower bound * @param upper the upper bound * @param lowerInclusive <code>true</code> if the lower bound is inclusive, otherwise, <code>false</code> * @param upperInclusive <code>true</code> if the upper bound is inclusive, otherwise, <code>false</code> * @param numericAnalyzer the {@link NumericAnalyzer} associated with the upper and lower bounds */ public NodeNumericRangeQueryNode(final NumericQueryNode lower, final NumericQueryNode upper, final boolean lowerInclusive, final boolean upperInclusive, final NumericAnalyzer numericAnalyzer) throws QueryNodeException { if (numericAnalyzer == null) { throw new IllegalArgumentException("numericAnalyzer cannot be null!"); } super.setBounds(lower, upper, lowerInclusive, upperInclusive); this.numericAnalyzer = numericAnalyzer; this.numericType = numericAnalyzer.getNumericParser().getNumericType(); }
children.add(upper); set(children);
@Override public String toString() { StringBuilder sb = new StringBuilder("<").append(getClass().getCanonicalName()); sb.append(" lowerInclusive=").append(isLowerInclusive()); sb.append(" upperInclusive=").append(isUpperInclusive()); sb.append(">\n\t"); sb.append(getUpperBound()).append("\n\t"); sb.append(getLowerBound()).append("\n"); sb.append("</").append(getClass().getCanonicalName()).append(">\n"); return sb.toString(); }
/** * Returns the field associated with this node. * * @return the field associated with this node * * @see FieldableNode */ @Override public CharSequence getField() { CharSequence field = null; T lower = getLowerBound(); T upper = getUpperBound(); if (lower != null) { field = lower.getField(); } else if (upper != null) { field = upper.getField(); } return field; }
super.setBounds(lower, upper, lowerInclusive, upperInclusive); this.numericConfig = numericConfig;
/** * Returns the upper bound node. * * @return the upper bound node. */ @Override @SuppressWarnings("unchecked") public T getUpperBound() { return (T) getChildren().get(1); }
/** * Returns the field associated with this node. * * @return the field associated with this node * * @see FieldableNode */ @Override public CharSequence getField() { CharSequence field = null; T lower = getLowerBound(); T upper = getUpperBound(); if (lower != null) { field = lower.getField(); } else if (upper != null) { field = upper.getField(); } return field; }
super.setBounds(lower, upper, lowerInclusive, upperInclusive); this.numericConfig = numericConfig;
/** * Returns the lower bound node. * * @return the lower bound node. */ @Override @SuppressWarnings("unchecked") public T getLowerBound() { return (T) getChildren().get(0); }
StringBuilder sb = new StringBuilder(); T lower = getLowerBound(); T upper = getUpperBound();
/** * Returns the upper bound node. * * @return the upper bound node. */ @Override @SuppressWarnings("unchecked") public T getUpperBound() { return (T) getChildren().get(1); }
StringBuilder sb = new StringBuilder(); T lower = getLowerBound(); T upper = getUpperBound();