/** * Convenience method which evaluates the expressions and trys to align the values to be of the * same type. * * <p>If the values can not be aligned, the original values are returned. * * @return */ protected Object[] eval(Object object) { Object v1 = eval(getExpression1(), object); Object v2 = eval(getExpression2(), object); return eval(v1, v2); }
curState = "LowerBoundary"; } else if (curState.equals("LowerBoundary")) { ((BinaryComparisonAbstract) curFilter).setExpression1(expression); curState = "UpperBoundary"; } else if (curState.equals("UpperBoundary")) { ((BinaryComparisonAbstract) curFilter).setExpression2(expression); curState = "complete"; } else { ((BinaryComparisonAbstract) curFilter).setExpression1(expression); curState = "rightValue"; } else if (curState.equals("rightValue")) { ((BinaryComparisonAbstract) curFilter).setExpression2(expression); curState = "complete"; } else { ((BinaryComparisonAbstract) curFilter).setExpression1(expression); curState = "rightValue"; } else if (curState.equals("rightValue")) { ((BinaryComparisonAbstract) curFilter).setExpression2(expression);
/** * Sets the binary comparison abstract. * * @param filter the filter * @param filterName the filter name */ private void setBinaryComparisonAbstract(Filter filter, FilterName filterName) { setExpressionParameter( ((BinaryComparisonAbstract) filter).getExpression1(), filterName.getParameter(0)); setExpressionParameter( ((BinaryComparisonAbstract) filter).getExpression2(), filterName.getParameter(1)); // Gets round the problem with PropertyIsGreaterThan // which has no matchCase parameter if (filterName.getParameterList().size() > 2) { setExpressionParameter( ff.literal(((BinaryComparisonAbstract) filter).isMatchingCase()), filterName.getParameter(2)); } }
public void setExpression1(org.opengis.filter.expression.Expression expression) { if (expression instanceof Expression) { Expression leftGeometry = (Expression) expression; // Checks if this is geometry filter or not and handles appropriately if (DefaultExpression.isGeometryExpression(leftGeometry.getType()) || permissiveConstruction) { super.setExpression1(leftGeometry); } else { throw new IllegalFilterException("Attempted to add (left)" + " non-geometry expression" + " to geometry filter."); } } else { // I guess we assume it is a good expression... super.setExpression1(expression); } }
public void setExpression2(org.opengis.filter.expression.Expression expression) { if (expression instanceof Expression) { Expression rightGeometry = (Expression) expression; // Checks if this is math filter or not and handles appropriately if (DefaultExpression.isGeometryExpression(rightGeometry.getType()) || permissiveConstruction) { super.setExpression2(rightGeometry); } else { throw new IllegalFilterException("Attempted to add (right)" + " non-geometry" + "expression to geometry filter."); } } else { // I guess we assume it is a good expression... super.setExpression2(expression); } }
public void setExpression1(org.opengis.filter.expression.Expression expression) { Expression leftGeometry = (Expression)expression; //Checks if this is geometry filter or not and handles appropriately if (DefaultExpression.isGeometryExpression(leftGeometry.getType()) || permissiveConstruction) { super.setExpression1(leftGeometry); } else { throw new IllegalFilterException("Attempted to add (left)" + " non-geometry expression" + " to geometry filter."); } }
public void setExpression2(org.opengis.filter.expression.Expression expression) { Expression rightGeometry = (Expression)expression; //Checks if this is math filter or not and handles appropriately if (DefaultExpression.isGeometryExpression(rightGeometry.getType()) || permissiveConstruction) { super.setExpression2(rightGeometry); } else { throw new IllegalFilterException("Attempted to add (right)" + " non-geometry" + "expression to geometry filter."); } } /**
/** * Convenience method which evaluates the expressions and trys to align the values to be of the * same type. * <p> * If the values can not be aligned, the original values are returned. * </p> * * @return */ protected Object[] eval(Object object) { Object v1 = eval(getExpression1(), object); Object v2 = eval(getExpression2(), object); return eval(v1, v2); }
Value v1 = new Value( eval( getExpression1(), object ) ); Value v2 = new Value( eval( getExpression2(), object ) );