use of ddf.catalog.filter.FilterDelegate in project ddf by codice.
the class GeotoolsFilterAdapterImpl method visit.
public Object visit(Begins begins, Object delegate) {
ExpressionValues filterValues = getExpressions(begins, delegate);
if (filterValues.literal instanceof Period) {
Period period = (Period) filterValues.literal;
Date start = period.getBeginning().getPosition().getDate();
Date end = period.getEnding().getPosition().getDate();
return ((FilterDelegate<?>) delegate).begins(filterValues.propertyName, start, end);
} else {
throw new UnsupportedOperationException(Begins.NAME + "filter not supported by Filter Adapter.");
}
}
use of ddf.catalog.filter.FilterDelegate in project ddf by codice.
the class GeotoolsFilterAdapterImpl method visit.
public Object visit(PropertyIsLessThan filter, Object delegate) {
ExpressionValues filterValues = getExpressions(filter, delegate);
String propertyName = filterValues.propertyName;
Object literal = filterValues.literal;
// Are property name and literal reversed?
if (filter.getExpression1() instanceof Literal) {
// convert literal < property to property > literal
Filter greaterThan = FF.greater(FF.property(propertyName), FF.literal(literal));
return greaterThan.accept(this, delegate);
}
if (literal instanceof String) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, (String) literal);
} else if (literal instanceof Date) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, (Date) literal);
} else if (literal instanceof Integer) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, ((Integer) literal).intValue());
} else if (literal instanceof Short) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, ((Short) literal).shortValue());
} else if (literal instanceof Long) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, ((Long) literal).longValue());
} else if (literal instanceof Float) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, ((Float) literal).floatValue());
} else if (literal instanceof Double) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, ((Double) literal).doubleValue());
} else if (literal instanceof Boolean) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, literal);
} else if (literal instanceof byte[]) {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, literal);
} else {
return ((FilterDelegate<?>) delegate).propertyIsLessThan(propertyName, literal);
}
}
use of ddf.catalog.filter.FilterDelegate in project ddf by codice.
the class GeotoolsFilterAdapterImpl method visit.
public Object visit(PropertyIsLessThanOrEqualTo filter, Object delegate) {
ExpressionValues filterValues = getExpressions(filter, delegate);
String propertyName = filterValues.propertyName;
Object literal = filterValues.literal;
// Are property name and literal reversed?
if (filter.getExpression1() instanceof Literal) {
// convert literal <= property to property >= literal
Filter greaterThanOrEqual = FF.greaterOrEqual(FF.property(propertyName), FF.literal(literal));
return greaterThanOrEqual.accept(this, delegate);
}
if (literal instanceof String) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, (String) literal);
} else if (literal instanceof Date) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, (Date) literal);
} else if (literal instanceof Integer) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, ((Integer) literal).intValue());
} else if (literal instanceof Short) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, ((Short) literal).shortValue());
} else if (literal instanceof Long) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, ((Long) literal).longValue());
} else if (literal instanceof Float) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, ((Float) literal).floatValue());
} else if (literal instanceof Double) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, ((Double) literal).doubleValue());
} else if (literal instanceof Boolean) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, literal);
} else if (literal instanceof byte[]) {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, literal);
} else {
return ((FilterDelegate<?>) delegate).propertyIsLessThanOrEqualTo(propertyName, literal);
}
}
Aggregations