IterableFilter

See javadoc - uk.gov.gchq.koryphe.impl.function.IterableFilter

Available since Koryphe version 1.6.0

An IterableFilter applies a given predicate to each element in an Iterable and returns the filtered iterable

Examples

Iterable filter

Java
JSON
Full JSON
Python
final IterableFilter<Integer> function = new IterableFilter<>(new IsMoreThan(5));
{
  "class" : "IterableFilter",
  "predicate" : {
    "class" : "IsMoreThan",
    "orEqualTo" : false,
    "value" : 5
  }
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.IterableFilter",
  "predicate" : {
    "class" : "uk.gov.gchq.koryphe.impl.predicate.IsMoreThan",
    "orEqualTo" : false,
    "value" : 5
  }
}
g.IterableFilter( 
  predicate=g.IsMoreThan( 
    value=5, 
    or_equal_to=False 
  ) 
)

Input type:

java.lang.Iterable

Example inputs:

Input TypeInputResult TypeResult
java.util.ArrayList[1, 2, 3]uk.gov.gchq.koryphe.util.IterableUtil$FilteredIterable[]
java.util.ArrayList[5, 10, 15]uk.gov.gchq.koryphe.util.IterableUtil$FilteredIterable[10, 15]
java.util.ArrayList[7, 9, 11]uk.gov.gchq.koryphe.util.IterableUtil$FilteredIterable[7, 9, 11]
java.util.ArrayList[1, null, 3]uk.gov.gchq.koryphe.util.IterableUtil$FilteredIterable[]
nullnull

results matching ""

    No results matching ""