use of uk.gov.gchq.gaffer.function.filter.IsMoreThan in project Gaffer by gchq.
the class OrExample method property1IsLessThan2OrProperty2IsMoreThan2.
public void property1IsLessThan2OrProperty2IsMoreThan2() {
// ---------------------------------------------------------
final Or function = new Or(Arrays.asList(new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
0).execute(new IsLessThan(2)).build(), new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select second property
1).execute(new IsMoreThan(2)).build()));
// ---------------------------------------------------------
runExample(function, new Object[] { 1, 3 }, new Object[] { 1, 1 }, new Object[] { 3, 3 }, new Object[] { 3, 1 }, new Object[] { 1L, 3L }, new Object[] { 1 });
}
use of uk.gov.gchq.gaffer.function.filter.IsMoreThan in project Gaffer by gchq.
the class OrExample method isLessThan2OrIsMoreThan2.
public void isLessThan2OrIsMoreThan2() {
// ---------------------------------------------------------
final Or function = new Or(Arrays.asList(new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
0).execute(new IsLessThan(2)).build(), new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
0).execute(new IsMoreThan(2)).build()));
// ---------------------------------------------------------
runExample(function, new Object[] { 1 }, new Object[] { 2 }, new Object[] { 3 }, new Object[] { 1L }, new Object[] { 3L });
}
use of uk.gov.gchq.gaffer.function.filter.IsMoreThan in project Gaffer by gchq.
the class MapFilterExample method freqMapIsMoreThan2.
public void freqMapIsMoreThan2() {
// ---------------------------------------------------------
final MapFilter function = new MapFilter("key1", new IsMoreThan(2L));
// ---------------------------------------------------------
final FreqMap map1 = new FreqMap();
map1.put("key1", 1L);
final FreqMap map2 = new FreqMap();
map2.put("key1", 2L);
final FreqMap map3 = new FreqMap();
map3.put("key1", 3L);
final FreqMap map4 = new FreqMap();
map4.put("key1", 3L);
map4.put("key2", 0L);
final FreqMap map5 = new FreqMap();
map5.put("key2", 3L);
runExample(function, map1, map2, map3, map4, map5);
}
Aggregations