LOGGER.finer("Filter type id is " + filter.getFilterType()); LOGGER.finer("Filter type text is " + comparisions.get(new Integer(filter.getFilterType()))); filter.getFilterType()));
LOGGER.finer("Filter type id is " + filter.getFilterType()); LOGGER.finer("Filter type text is " + comparisions.get(new Integer(filter.getFilterType()))); filter.getFilterType()));
DefaultExpression right = (DefaultExpression) filter.getRightValue(); String type = (String) comparisions.get(new Integer( filter.getFilterType())); if ( filter.getFilterType() == Filter.COMPARE_EQUALS || filter.getFilterType() == Filter.COMPARE_NOT_EQUALS ) {
LOGGER.finer("Filter type id is " + filter.getFilterType()); LOGGER.finer("Filter type text is " + comparisions.get(new Integer(filter.getFilterType()))); filter.getFilterType())); if ( (right == null) && (filter.getFilterType()==FilterType.COMPARE_EQUALS ) ) if ( filter.getFilterType() == Filter.COMPARE_EQUALS || filter.getFilterType() == Filter.COMPARE_NOT_EQUALS ) {
public void visit(org.geotools.filter.CompareFilter filter) { Expression left = filter.getLeftValue(); Expression right = filter.getRightValue(); String type = (String) comparisions.get(new Integer( filter.getFilterType())); start(type); left.accept(this); right.accept(this); end(type); }
/** * 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 are the same as well as both of the values. * * @param obj - the object to compare this CompareFilter against. * * @return true if specified object is equal to this filter; false * otherwise. */ public boolean equals(Object obj) { if (obj instanceof CompareFilter) { CompareFilter cFilter = (CompareFilter) obj; // todo - check for nulls here, or make immutable. // return filterType == cFilter.getFilterType() && ( expression1 == cFilter.getLeftValue() || (expression1 != null && expression1.equals( cFilter.getLeftValue() ) ) ) && ( expression2 == cFilter.getRightValue() || (expression2 != null && expression2.equals( cFilter.getRightValue() ) ) ); } else { return false; } }
/** * 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 are the same as well as both of the values. * * @param obj - the object to compare this CompareFilter against. * * @return true if specified object is equal to this filter; false * otherwise. */ public boolean equals(Object obj) { if (obj instanceof CompareFilter) { CompareFilter cFilter = (CompareFilter) obj; // todo - check for nulls here, or make immutable. // return filterType == cFilter.getFilterType() && ( expression1 == cFilter.getLeftValue() || (expression1 != null && expression1.equals( cFilter.getLeftValue() ) ) ) && ( expression2 == cFilter.getRightValue() || (expression2 != null && expression2.equals( cFilter.getRightValue() ) ) ); } else { return false; } }
public void visit(CompareFilter filter) { CompareFilter copy = null; try { Expression leftCopy = null; if (filter.getLeftValue() != null) { filter.getLeftValue().accept(this); leftCopy = (Expression) pages.pop(); } Expression rightCopy = null; if (filter.getRightValue() != null) { filter.getRightValue().accept(this); rightCopy = (Expression) pages.pop(); } copy = ff.createCompareFilter(filter.getFilterType()); copy.addLeftValue(leftCopy); copy.addRightValue(rightCopy); } catch (IllegalFilterException erp) { throw new RuntimeException(erp); } pages.push(copy); }