Search in sources :

Example 6 with IsMoreThan

use of uk.gov.gchq.koryphe.impl.predicate.IsMoreThan 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));
}
Also used : IsLessThan(uk.gov.gchq.koryphe.impl.predicate.IsLessThan) And(uk.gov.gchq.koryphe.impl.predicate.And) IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)

Example 7 with IsMoreThan

use of uk.gov.gchq.koryphe.impl.predicate.IsMoreThan 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);
}
Also used : IsLessThan(uk.gov.gchq.koryphe.impl.predicate.IsLessThan) And(uk.gov.gchq.koryphe.impl.predicate.And) IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)

Example 8 with IsMoreThan

use of uk.gov.gchq.koryphe.impl.predicate.IsMoreThan in project gaffer-doc by gchq.

the class IfExample method applyPredicatesToInput.

public void applyPredicatesToInput() {
    // ---------------------------------------------------------
    final If<Comparable> predicate = new If<>(new IsA(Integer.class), new IsMoreThan(3), new Not<>(new IsA(String.class)));
    // ---------------------------------------------------------
    runExample(predicate, "This example tests first whether the input is an Integer. " + "If so, it is then tested to see if the value is greater than 3. " + "Otherwise, since it is not an Integer, we then test to see if it is NOT a String.", 2, 3, 5, "test", new HashMap<>(), new ArrayList<>());
}
Also used : IsA(uk.gov.gchq.koryphe.impl.predicate.IsA) IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan) If(uk.gov.gchq.koryphe.impl.predicate.If)

Example 9 with IsMoreThan

use of uk.gov.gchq.koryphe.impl.predicate.IsMoreThan in project gaffer-doc by gchq.

the class IsMoreThanExample method isMoreThan5.

public void isMoreThan5() {
    // ---------------------------------------------------------
    final IsMoreThan function = new IsMoreThan(5);
    // ---------------------------------------------------------
    runExample(function, null, 1, 5, 10);
}
Also used : IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)

Example 10 with IsMoreThan

use of uk.gov.gchq.koryphe.impl.predicate.IsMoreThan in project gaffer-doc by gchq.

the class IsMoreThanExample method isMoreThanOrEqualTo5.

public void isMoreThanOrEqualTo5() {
    // ---------------------------------------------------------
    final IsMoreThan function = new IsMoreThan(5, true);
    // ---------------------------------------------------------
    runExample(function, null, 1, 5, 10);
}
Also used : IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)

Aggregations

IsMoreThan (uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)72 Test (org.junit.jupiter.api.Test)42 ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)40 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)34 ViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition)24 Element (uk.gov.gchq.gaffer.data.element.Element)22 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)22 Edge (uk.gov.gchq.gaffer.data.element.Edge)20 GetElements (uk.gov.gchq.gaffer.operation.impl.get.GetElements)20 User (uk.gov.gchq.gaffer.user.User)20 Graph (uk.gov.gchq.gaffer.graph.Graph)19 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)19 ArrayList (java.util.ArrayList)18 HashSet (java.util.HashSet)16 Entity (uk.gov.gchq.gaffer.data.element.Entity)16 IsEqual (uk.gov.gchq.koryphe.impl.predicate.IsEqual)13 IsLessThan (uk.gov.gchq.koryphe.impl.predicate.IsLessThan)13 Set (java.util.Set)12 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)12 OperationException (uk.gov.gchq.gaffer.operation.OperationException)12