/** * Sets the values to be compared as between the left and right values. * * @param middleValue The expression to be compared. * @deprecated use {@link #setExpression(org.opengis.filter.expression.Expression)} */ public final void addMiddleValue(Expression middleValue) { setExpression(middleValue); }
/** Sets the left,lower, or first expression. */ public void setLowerBoundary(org.opengis.filter.expression.Expression lowerBounds) { setExpression1(lowerBounds); }
/** Sets the right,upper, or second expression. */ public void setUpperBoundary(org.opengis.filter.expression.Expression upperBounds) { setExpression2(upperBounds); }
/** * Returns true if the passed in object is the same as this filter. Checks to make sure the * filter types are the same as well as all three of the values. * * @param oFilter the filter to test for eqaulity. * @return True if the objects are equal. */ public boolean equals(Object oFilter) { if (oFilter.getClass() == this.getClass()) { BetweenFilterImpl bFilter = (BetweenFilterImpl) oFilter; return (expression1 == bFilter.getExpression1() || (expression1 != null && expression1.equals(bFilter.getExpression1()))) && (expression2 == bFilter.getExpression2() || (expression2 != null && expression2.equals(bFilter.getExpression2()))) && (expression1 == bFilter.getExpression() || (middleValue != null && middleValue.equals(bFilter.getExpression()))); } else { return false; } }
public void testBetweenFilter() throws IllegalFilterException { BetweenFilterImpl bFilter1 = new BetweenFilterImpl(); BetweenFilterImpl bFilter2 = new BetweenFilterImpl(); LiteralExpressionImpl testLit1 = new LiteralExpressionImpl(Integer.valueOf(55)); LiteralExpressionImpl testLit2 = new LiteralExpressionImpl(Integer.valueOf(55)); testExp1 = new LiteralExpressionImpl(Integer.valueOf(45)); testExp2 = new LiteralExpressionImpl(Integer.valueOf(45)); testExp3 = new AttributeExpressionImpl(testSchema, "testInteger"); testExp4 = new AttributeExpressionImpl(testSchema, "testInteger"); bFilter1.setExpression1(testExp1); bFilter2.setExpression1(testExp2); bFilter1.setExpression(testExp3); bFilter2.setExpression(testExp4); bFilter1.setExpression2(testLit1); bFilter2.setExpression2(testLit2); assertTrue(bFilter2.equals(bFilter1)); tFilter1 = ff.equals( org.opengis.filter.expression.Expression.NIL, org.opengis.filter.expression.Expression.NIL); assertTrue(!bFilter2.equals(tFilter1)); bFilter2.setExpression2(new LiteralExpressionImpl(Integer.valueOf(65))); assertTrue(!bFilter2.equals(bFilter1)); }
public void testContains() throws Exception { BetweenFilterImpl a = new BetweenFilterImpl(); SimpleFeatureType schema = ftb.buildFeatureType(); a.setExpression1(new LiteralExpressionImpl(new Double(5))); a.setExpression2(new LiteralExpressionImpl(new Double(15))); a.setExpression(new AttributeExpressionImpl(schema, "value")); null); assertEquals(true, a.evaluate(f1)); // in between assertEquals(false, a.evaluate(f2)); // too small assertEquals(true, a.evaluate(f3)); // max value assertEquals(true, a.evaluate(f4)); // min value assertEquals(false, a.evaluate(f5)); // too large
/** * Returns true if the passed in object is the same as this filter. Checks * to make sure the filter types are the same as well as all three of the * values. * * @param oFilter the filter to test for eqaulity. * * @return True if the objects are equal. */ public boolean equals(Object oFilter) { if (oFilter.getClass() == this.getClass()) { BetweenFilterImpl bFilter = (BetweenFilterImpl) oFilter; return ((bFilter.getFilterType() == this.filterType) && bFilter.getLeftValue().equals(this.expression1) && bFilter.getMiddleValue().equals(this.middleValue) && bFilter.getRightValue().equals(this.expression2)); } else { return false; } }
/** * Creates an empty Between Filter. * * @return The new Between Filter. * * @throws IllegalFilterException if there were creation problems. */ public BetweenFilter createBetweenFilter() throws IllegalFilterException { return new BetweenFilterImpl(); }
/** Returns the left,lower, or first expression. */ public org.opengis.filter.expression.Expression getLowerBoundary() { return getExpression1(); }
/** Returns the right,upper, or second expression. */ public org.opengis.filter.expression.Expression getUpperBoundary() { return getExpression2(); }
/** * Gets the middle value of the between. * * @return The expression in the middle. * * @deprecated use {@link #getExpression()} */ public final Expression getMiddleValue() { return (Expression) getExpression(); }
/** * Returns true if the passed in object is the same as this filter. Checks * to make sure the filter types are the same as well as all three of the * values. * * @param oFilter the filter to test for eqaulity. * * @return True if the objects are equal. */ public boolean equals(Object oFilter) { if (oFilter.getClass() == this.getClass()) { BetweenFilterImpl bFilter = (BetweenFilterImpl) oFilter; return ((bFilter.getFilterType() == this.filterType) && bFilter.getLeftValue().equals(this.expression1) && bFilter.getMiddleValue().equals(this.middleValue) && bFilter.getRightValue().equals(this.expression2)); } else { return false; } }
/** * Creates an empty Between Filter. * * @return The new Between Filter. * * @throws IllegalFilterException if there were creation problems. */ public BetweenFilter createBetweenFilter() throws IllegalFilterException { return new BetweenFilterImpl(); }
/** * Returns the left,lower, or first expression. */ public org.opengis.filter.expression.Expression getLowerBoundary() { return getExpression1(); }
/** * Returns the right,upper, or second expression. */ public org.opengis.filter.expression.Expression getUpperBoundary() { return getExpression2(); }
/** * Gets the middle value of the between. * * @return The expression in the middle. * * @deprecated use {@link #getExpression()} */ public final Expression getMiddleValue() { return (Expression) getExpression(); }
curFilter = new BetweenFilterImpl(); } else if (filterType == AbstractFilter.NULL) { curFilter = new NullFilterImpl(); break; case FilterType.BETWEEN: curFilter = new BetweenFilterImpl(); break; default:
((BetweenFilterImpl) curFilter).setExpression(expression); curState = "LowerBoundary"; } else if (curState.equals("LowerBoundary")) {