ApplyBiFunction

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

Available since Koryphe version 1.8.0

Applies the given BiFunction

Examples

Apply bi function using sum

Java
JSON
Full JSON
Python
final ApplyBiFunction<Number, Number, Number> function = new ApplyBiFunction<>(new Sum());
{
  "class" : "ApplyBiFunction",
  "function" : {
    "class" : "Sum"
  }
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ApplyBiFunction",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Sum"
  }
}
g.ApplyBiFunction( 
  function=g.Sum() 
)

Input type:

java.lang.Number, java.lang.Number

Example inputs:

Input TypeInputResult TypeResult
[java.lang.Integer, java.lang.Integer][1, 2]java.lang.Integer3
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer][1, 2, 3, 4]java.lang.Integer3
[java.lang.Double, java.lang.Double][1.1, 2.2]java.lang.Double3.3000000000000003

Apply bi function using max

Java
JSON
Full JSON
Python
final ApplyBiFunction<Comparable, Comparable, Comparable> function = new ApplyBiFunction<>(new Max());
{
  "class" : "ApplyBiFunction",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Max"
  }
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ApplyBiFunction",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Max"
  }
}
g.ApplyBiFunction( 
  function=g.Max() 
)

Input type:

java.lang.Comparable, java.lang.Comparable

Example inputs:

Input TypeInputResult TypeResult
[java.lang.Integer, java.lang.Integer][1, 2]java.lang.Integer2
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer][1, 2, 3, 4]java.lang.Integer2
[java.lang.Double, java.lang.Double][1.1, 2.2]java.lang.Double2.2

Apply bi function using min

Java
JSON
Full JSON
Python
final ApplyBiFunction<Comparable, Comparable, Comparable> function = new ApplyBiFunction<>(new Min());
{
  "class" : "ApplyBiFunction",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Min"
  }
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ApplyBiFunction",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Min"
  }
}
g.ApplyBiFunction( 
  function=g.Min() 
)

Input type:

java.lang.Comparable, java.lang.Comparable

Example inputs:

Input TypeInputResult TypeResult
[java.lang.Integer, java.lang.Integer][1, 2]java.lang.Integer1
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer][1, 2, 3, 4]java.lang.Integer1
[java.lang.Double, java.lang.Double][1.1, 2.2]java.lang.Double1.1

results matching ""

    No results matching ""