Tabnine Logo
IsLessThan
Code IndexAdd Tabnine to your IDE (free)

How to use
IsLessThan
in
uk.gov.gchq.koryphe.impl.predicate

Best Java code snippets using uk.gov.gchq.koryphe.impl.predicate.IsLessThan (Showing top 15 results out of 315)

origin: gchq/Gaffer

    .postAggregationFilter(new ElementFilter.Builder()
        .select(TestPropertyNames.COUNT)
        .execute(new IsLessThan(10))
        .build())
    .transformer(new ElementTransformer.Builder()
assertEquals(1, postFilterComponents.size());
assertArrayEquals(new String[]{TestPropertyNames.COUNT}, postFilterComponents.get(0).getSelection());
assertEquals(new IsLessThan(10), postFilterComponents.get(0).getPredicate());
origin: uk.gov.gchq.gaffer/parquet-store

private Pair<FilterPredicate, Set<Path>> addPrimitiveFilter(final Predicate filterFunction,
                              final String selection,
                              final String group) throws SerialisationException {
  // All supported filters will be in the if else statement below
  if (filterFunction instanceof IsEqual) {
    return addIsEqualFilter(selection, schemaUtils.getConverter(group).gafferObjectToParquetObjects(selection, ((IsEqual) filterFunction).getControlValue()), group, false);
  } else if (filterFunction instanceof IsLessThan) {
    if (((IsLessThan) filterFunction).getOrEqualTo()) {
      return addIsLessThanOrEqualToFilter(selection, schemaUtils.getConverter(group).gafferObjectToParquetObjects(selection, ((IsLessThan) filterFunction).getControlValue()), group);
    } else {
      return addIsLessThanFilter(selection, schemaUtils.getConverter(group).gafferObjectToParquetObjects(selection, ((IsLessThan) filterFunction).getControlValue()), group);
    }
  } else if (filterFunction instanceof IsMoreThan) {
    if (((IsMoreThan) filterFunction).getOrEqualTo()) {
      return addIsMoreThanOrEqualToFilter(selection, schemaUtils.getConverter(group).gafferObjectToParquetObjects(selection, ((IsMoreThan) filterFunction).getControlValue()), group);
    } else {
      return addIsMoreThanFilter(selection, schemaUtils.getConverter(group).gafferObjectToParquetObjects(selection, ((IsMoreThan) filterFunction).getControlValue()), group);
    }
  } else if (filterFunction instanceof IsTrue) {
    return new Pair<>(eq(booleanColumn(selection), Boolean.TRUE), getAllPathsForColumn(group));
  } else if (filterFunction instanceof IsFalse) {
    return new Pair<>(eq(booleanColumn(selection), Boolean.FALSE), getAllPathsForColumn(group));
  } else {
    LOGGER.warn(filterFunction.getClass().getCanonicalName() +
        " is not a natively supported filter by the Parquet store, therefore execution will take longer to perform this filter.");
    return null;
  }
}
origin: uk.gov.gchq.gaffer/doc

  public void isLessThanAString() {
    // ---------------------------------------------------------
    final IsLessThan function = new IsLessThan("B");
    // ---------------------------------------------------------

    runExample(function,
        null,
        1, "A", "B", "C");
  }
}
origin: uk.gov.gchq.gaffer/doc

public void isLessThanOrEqualTo5() {
  // ---------------------------------------------------------
  final IsLessThan function = new IsLessThan(5, true);
  // ---------------------------------------------------------
  runExample(function,
      null,
      1, 1L, 5, 5L, 10, 10L, "1");
}
origin: uk.gov.gchq.gaffer/doc

public void isLessThan5() {
  // ---------------------------------------------------------
  final IsLessThan function = new IsLessThan(5);
  // ---------------------------------------------------------
  runExample(function,
      null,
      1, 1L, 5, 5L, 10, 10L, "1");
}
origin: uk.gov.gchq.gaffer/doc

public void isLessThanALong5() {
  // ---------------------------------------------------------
  final IsLessThan function = new IsLessThan(5L);
  // ---------------------------------------------------------
  runExample(function,
      null,
      1, 1L, 5, 5L, 10, 10L, "1");
}
origin: uk.gov.gchq.gaffer/doc

public void isLessThan3AndIsMoreThan0() {
  // ---------------------------------------------------------
  final And function = new And<>(
      new IsLessThan(3),
      new IsMoreThan(0)
  );
  // ---------------------------------------------------------
  runExample(function,
      null,
      0, 1, 2, 3, 1L, 2L);
}
origin: uk.gov.gchq.gaffer/doc

public void isLessThan2EqualTo5OrIsMoreThan10() {
  // ---------------------------------------------------------
  final Or function = new Or<>(
      new IsLessThan(2),
      new IsEqual(5),
      new IsMoreThan(10)
  );
  // ---------------------------------------------------------
  runExample(function,
      "When using an Or predicate with a single selected value you can just use the constructor new Or(predicates))'",
      1, 2, 3, 5, 15, 1L, 3L, 5L);
}
origin: uk.gov.gchq.gaffer/spark-library

} else if (filter instanceof LessThan) {
  final LessThan lessThan = (LessThan) filter;
  final Predicate<?> isLessThan = new IsLessThan((Comparable<?>) lessThan.value(), false);
  final Set<String> relevantGroups = getGroupsFromFilter(filter);
  if (null != relevantGroups) {
} else if (filter instanceof LessThanOrEqual) {
  final LessThanOrEqual lessThan = (LessThanOrEqual) filter;
  final Predicate<?> isLessThan = new IsLessThan((Comparable<?>) lessThan.value(), true);
  final Set<String> relevantGroups = getGroupsFromFilter(filter);
  if (null != relevantGroups) {
origin: uk.gov.gchq.gaffer/doc

public CloseableIterable<? extends Element> getEntitiesRelatedTo2WithCountLessThan2OrMoreThan5() {
  // ---------------------------------------------------------
  final GetElements operation = new GetElements.Builder()
      .input(new EntitySeed(2), new EdgeSeed(2, 3, DirectedType.EITHER))
      .view(new View.Builder()
          .entity("entity", new ViewElementDefinition.Builder()
              .preAggregationFilter(
                  new ElementFilter.Builder()
                      .select("count")
                      .execute(new Or<>(new IsLessThan(2), new IsMoreThan(5)))
                      .build())
              .build())
          .build())
      .build();
  // ---------------------------------------------------------
  return runExample(operation,
      "When using an Or predicate with a single selected value you can just do 'select(propertyName)' then 'execute(new Or(predicates))'");
}
origin: uk.gov.gchq.gaffer/doc

  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));
  }
}
origin: uk.gov.gchq.gaffer/doc

  public void firstItemIsLessThan2OrSecondItemIsMoreThan10() {
    // ---------------------------------------------------------
    final Or function = new Or.Builder()
        .select(0)
        .execute(new IsLessThan(2))
        .select(1)
        .execute(new IsMoreThan(10))
        .build();
    // ---------------------------------------------------------

    runExample(function,
        "When using an Or predicate with multiple selected values, you need to use the Or.Builder to build your Or predicate, using .select() then .execute(). " +
            "When selecting values in the Or.Builder you need to refer to the position in the input array. I.e to use the first value use position 0 - select(0)." +
            "You can select multiple values to give to a predicate like isXLessThanY, this is achieved by passing 2 positions to the selec method - select(0, 1)",
        new Tuple2<>(1, 15),
        new Tuple2<>(1, 1),
        new Tuple2<>(15, 15),
        new Tuple2<>(15, 1),
        new Tuple2<>(1L, 15L),
        new Tuple1<>(1));
  }
}
origin: uk.gov.gchq.gaffer/doc

  public CloseableIterable<? extends Element> getEdgesRelatedTo2WhenSourceIsLessThan2OrDestinationIsMoreThan3() {
    // ---------------------------------------------------------
    final GetElements operation = new GetElements.Builder()
        .input(new EntitySeed(2))
        .view(new View.Builder()
            .edge("edge", new ViewElementDefinition.Builder()
                .preAggregationFilter(
                    new ElementFilter.Builder()
                        .select(IdentifierType.SOURCE.name(), IdentifierType.DESTINATION.name())
                        .execute(new Or.Builder<>()
                            .select(0)
                            .execute(new IsLessThan(2))
                            .select(1)
                            .execute(new IsMoreThan(3))
                            .build())
                        .build())
                .build())
            .build())
        .build();
    // ---------------------------------------------------------

    return runExample(operation,
        "When using an Or predicate with a multiple selected values, it is more complicated. " +
            "First, you need to select all the values you want: 'select(a, b, c)'. This will create an array of the selected values, [a, b, c]. " +
            "You then need to use the Or.Builder to build your Or predicate, using .select() then .execute(). " +
            "When selecting values in the Or.Builder you need to refer to the position in the [a,b,c] array. So to use property 'a', use position 0 - select(0).");
  }
}
origin: uk.gov.gchq.gaffer/doc

.execute(new IsMoreThan(MAY_01_2000, true))
.select("endDate")
.execute(new IsLessThan(MAY_02_2000, false))
.build()
.execute(new IsMoreThan(MAY_01_2000, true))
.select("endDate")
.execute(new IsLessThan(MAY_03_2000, false))
.build()
origin: uk.gov.gchq.gaffer/doc

    .execute(new IsMoreThan(JAN_01_2000, true))
    .select("endDate")
    .execute(new IsLessThan(JAN_01_2001, false))
    .build())
.postAggregationFilter(new ElementFilter.Builder()
uk.gov.gchq.koryphe.impl.predicateIsLessThan

Javadoc

An IsLessThan is a java.util.function.Predicate that checks that the input Comparable is less than a control value. There is also an orEqualTo flag that can be set to allow the input value to be less than or equal to the control value.

Most used methods

  • <init>
  • getControlValue
  • getOrEqualTo

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now