org.tensorics.core.functional.Func4 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tensorics-core Show documentation
Show all versions of tensorics-core Show documentation
Tensorics is a java framework which uses a tensor as a central object. A tensor represents a set of values placed in an N-dimensional space. Wherever you are tempted to use maps of maps, a tensor might be a good choice ;-) Tensorics provides methods to create, transform and performing calculations with those tensors.
/**
* Copyright (c) 2016 European Organisation for Nuclear Research (CERN), All Rights Reserved.
*/
package org.tensorics.core.functional;
/**
* Represents a function with four arguments.
*
* @param the first argument type
* @param the second argument type
* @param the third argument type
* @param the fourth argument type
* @param the result type
*/
@FunctionalInterface
public interface Func4 extends FiniteArgumentFunction {
R apply(T1 t1, T2 t2, T3 t3, T4 t4);
@Override
@SuppressWarnings("unchecked")
default FuncN toFuncN() {
return args -> apply((T1) args[0], (T2) args[1], (T3) args[2], (T4) args[3]);
}
@Override
default int numberOfArgs() {
return 4;
}
}