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 Type | Input | Result Type | Result |
---|---|---|---|
[java.lang.Integer, java.lang.Integer] | [1, 2] | java.lang.Integer | 3 |
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer] | [1, 2, 3, 4] | java.lang.Integer | 3 |
[java.lang.Double, java.lang.Double] | [1.1, 2.2] | java.lang.Double | 3.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 Type | Input | Result Type | Result |
---|---|---|---|
[java.lang.Integer, java.lang.Integer] | [1, 2] | java.lang.Integer | 2 |
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer] | [1, 2, 3, 4] | java.lang.Integer | 2 |
[java.lang.Double, java.lang.Double] | [1.1, 2.2] | java.lang.Double | 2.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 Type | Input | Result Type | Result |
---|---|---|---|
[java.lang.Integer, java.lang.Integer] | [1, 2] | java.lang.Integer | 1 |
[java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer] | [1, 2, 3, 4] | java.lang.Integer | 1 |
[java.lang.Double, java.lang.Double] | [1.1, 2.2] | java.lang.Double | 1.1 |