use of uk.gov.gchq.koryphe.impl.predicate.And in project gaffer-doc by gchq.
the class AndExample method firstItemIsLessThan2AndSecondItemIsMoreThan5.
public void firstItemIsLessThan2AndSecondItemIsMoreThan5() {
// ---------------------------------------------------------
final And function = new And.Builder().select(0).execute(new IsLessThan(2)).select(1).execute(new IsMoreThan(5)).build();
// ---------------------------------------------------------
runExample(function, null, new Tuple2<>(1, 10), new Tuple2<>(1, 1), new Tuple2<>(10, 10), new Tuple2<>(10, 1), new Tuple2<>(1L, 10L), new Tuple1<>(1));
}
use of uk.gov.gchq.koryphe.impl.predicate.And in project gaffer-doc by gchq.
the class AndExample method isLessThan3AndIsMoreThan0.
public void isLessThan3AndIsMoreThan0() {
// ---------------------------------------------------------
final And function = new And<>(new IsLessThan(3), new IsMoreThan(0));
// ---------------------------------------------------------
runExample(function, null, 0, 1, 2, 3, 1L, 2L);
}
use of uk.gov.gchq.koryphe.impl.predicate.And in project Gaffer by gchq.
the class JavaPredicateToParquetPredicate method getParquetPredicate.
public FilterPredicate getParquetPredicate() throws SerialisationException {
FilterPredicate filterResult;
if (javaPredicate instanceof AgeOff) {
filterResult = getAgeOffPredicate((AgeOff) javaPredicate, selection, group, schemaUtils);
} else if (javaPredicate instanceof And) {
final And and = (And) javaPredicate;
filterResult = getAndFilter((List<Predicate>) and.getComponents(), selection, group, schemaUtils);
} else if (javaPredicate instanceof Or) {
final Or or = (Or) javaPredicate;
filterResult = getOrFilter((List<Predicate>) or.getComponents(), selection, group, schemaUtils);
} else if (javaPredicate instanceof Not) {
final Not not = (Not) javaPredicate;
final JavaPredicateToParquetPredicate predicateConverter = new JavaPredicateToParquetPredicate(schemaUtils, not.getPredicate(), selection, group);
final FilterPredicate parquetPredicate = predicateConverter.getParquetPredicate();
if (!predicateConverter.fullyApplied) {
fullyApplied = false;
}
filterResult = FilterPredicateUtils.not(parquetPredicate);
} else {
filterResult = getPrimitiveFilter(javaPredicate, selection[0], group, schemaUtils);
}
return filterResult;
}
Aggregations