Search in sources :

Example 1 with IsLessThan

use of uk.gov.gchq.koryphe.impl.predicate.IsLessThan 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 2 with IsLessThan

use of uk.gov.gchq.koryphe.impl.predicate.IsLessThan 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 3 with IsLessThan

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

the class IsLessThanExample method isLessThanALong5.

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

Example 4 with IsLessThan

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

the class IsLessThanExample method isLessThanOrEqualTo5.

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

Example 5 with IsLessThan

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

the class IsLessThanExample method isLessThanAString.

public void isLessThanAString() {
    // ---------------------------------------------------------
    final IsLessThan function = new IsLessThan("B");
    // ---------------------------------------------------------
    runExample(function, null, 1, "A", "B", "C");
}
Also used : IsLessThan(uk.gov.gchq.koryphe.impl.predicate.IsLessThan)

Aggregations

IsLessThan (uk.gov.gchq.koryphe.impl.predicate.IsLessThan)20 IsMoreThan (uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)13 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)8 Test (org.junit.jupiter.api.Test)6 IsEqual (uk.gov.gchq.koryphe.impl.predicate.IsEqual)6 TupleAdaptedPredicate (uk.gov.gchq.koryphe.tuple.predicate.TupleAdaptedPredicate)6 ArrayList (java.util.ArrayList)5 GreaterThan (org.apache.spark.sql.sources.GreaterThan)5 LessThan (org.apache.spark.sql.sources.LessThan)5 ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)5 ViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition)5 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)5 HashSet (java.util.HashSet)4 Predicate (java.util.function.Predicate)4 SparkSession (org.apache.spark.sql.SparkSession)4 Filter (org.apache.spark.sql.sources.Filter)4 Operation (uk.gov.gchq.gaffer.operation.Operation)4 GraphFilters (uk.gov.gchq.gaffer.operation.graph.GraphFilters)4 Schema (uk.gov.gchq.gaffer.store.schema.Schema)4 EqualTo (org.apache.spark.sql.sources.EqualTo)3