public void testNullFilter() throws IllegalFilterException { testExp1 = new AttributeExpressionImpl(testSchema, "testDouble"); testExp2 = new AttributeExpressionImpl(testSchema, "testDouble"); testExp3 = new AttributeExpressionImpl(testSchema, "testBoolean"); NullFilterImpl nullFilter1 = new NullFilterImpl(); NullFilterImpl nullFilter2 = new NullFilterImpl(); nullFilter1.setExpression(testExp1); nullFilter2.setExpression(testExp2); assertTrue(nullFilter1.equals(nullFilter2)); nullFilter1.setExpression(testExp3); assertTrue(!nullFilter1.equals(nullFilter2)); assertTrue(!nullFilter1.equals(new BetweenFilterImpl())); }
/** * Compares this filter to the specified object. Returns true if the passed in object is the * same as this filter. Checks to make sure the filter types, and the NullCheckValue are the * same. * * @param obj - the object to compare this LikeFilter against. * @return true if specified object is equal to this filter; false otherwise. */ public boolean equals(Object obj) { if (obj != null && obj.getClass() == this.getClass()) { NullFilterImpl nullFilter = (NullFilterImpl) obj; return ((Filters.getFilterType(nullFilter) == Filters.getFilterType(this)) && nullFilter.getExpression().equals(this.nullCheck)); } else { return false; } }
protected NullFilterImpl(org.opengis.filter.expression.Expression expresion) { setExpression(expresion); }
/** * Compares this filter to the specified object. Returns true if the * passed in object is the same as this filter. Checks to make sure the * filter types, and the NullCheckValue are the same. * * @param obj - the object to compare this LikeFilter against. * * @return true if specified object is equal to this filter; false * otherwise. */ public boolean equals(Object obj) { if (obj!=null && obj.getClass() == this.getClass()) { NullFilterImpl nullFilter = (NullFilterImpl) obj; return ((nullFilter.getFilterType() == this.filterType) && nullFilter.getNullCheckValue().equals(this.nullCheck)); } else { return false; } }
/** * Creates an empty Null Filter. * * @return The new Null Filter. */ public NullFilter createNullFilter() { return new NullFilterImpl(); }
((NullFilterImpl) curFilter).setExpression(expression); curState = "complete"; } else {
/** * Compares this filter to the specified object. Returns true if the * passed in object is the same as this filter. Checks to make sure the * filter types, and the NullCheckValue are the same. * * @param obj - the object to compare this LikeFilter against. * * @return true if specified object is equal to this filter; false * otherwise. */ public boolean equals(Object obj) { if (obj!=null && obj.getClass() == this.getClass()) { NullFilterImpl nullFilter = (NullFilterImpl) obj; return ((nullFilter.getFilterType() == this.filterType) && nullFilter.getNullCheckValue().equals(this.nullCheck)); } else { return false; } }
/** * Creates an empty Null Filter. * * @return The new Null Filter. */ public NullFilter createNullFilter() { return new NullFilterImpl(); }
/** * Determines whether or not a given feature is 'inside' this filter. * * @param nullCheck The attribute expression to null check. * * @throws IllegalFilterException If attempting to add a non-attribute * expression. * * @task REVISIT: change arg to AttributeExpression? * @task REVISIT: change name to setNullCheckValue. * * @deprecated use {@link PropertyIsNull#setExpression(Expression)} */ public final void nullCheckValue(Expression nullCheck) throws IllegalFilterException { setExpression(nullCheck); }
curFilter = new BetweenFilterImpl(); } else if (filterType == AbstractFilter.NULL) { curFilter = new NullFilterImpl(); } else if (filterType == AbstractFilter.LIKE) { curFilter = new LikeFilterImpl();
/** * Returns the expression being checked for null. * * @return the Expression to null check. * * @deprecated use {@link #getExpression()}. */ public final Expression getNullCheckValue() { return (Expression) getExpression(); }
/** * Determines whether or not a given feature is 'inside' this filter. * * @param nullCheck The attribute expression to null check. * * @throws IllegalFilterException If attempting to add a non-attribute * expression. * * @task REVISIT: change arg to AttributeExpression? * @task REVISIT: change name to setNullCheckValue. * * @deprecated use {@link PropertyIsNull#setExpression(Expression)} */ public final void nullCheckValue(Expression nullCheck) throws IllegalFilterException { setExpression(nullCheck); }
/** * Returns the expression being checked for null. * * @return the Expression to null check. * * @deprecated use {@link #getExpression()}. */ public final Expression getNullCheckValue() { return (Expression) getExpression(); }