ternary.checked.ObjIntDblToDblE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-ternary-core Show documentation
Show all versions of functions-ternary-core Show documentation
Provides functional interfaces for the most commonly used two-argument functions
package net.mintern.functions.ternary.checked;
/**
* An operation of type {@code (T, int, double) -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ObjIntDblToDblE {
/**
* Performs this operation.
*
* @param t argument 1
* @param i argument 2
* @param d argument 3
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
double call(T t, int i, double d) throws E;
/**
* Binds {@code (t)} to the beginning of {@code f}, returning a new function
* of type {@code (int, double) -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param t argument 1
* @return a new function {@code (int i, double d) -> double} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.IntDblToDblE
bind(ObjIntDblToDblE f, T t) {
return (i, d) -> f.call(t, i, d);
}
/**
* Binds {@code (t)} to the beginning of {@code this}, returning a new function
* of type {@code (int, double) -> double}.
*
* @param t argument 1
* @return a new function {@code (int i, double d) -> double} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.IntDblToDblE bind(T t) {
return ObjIntDblToDblE.bind(this, t);
}
/**
* Binds {@code (i, d)} to the end of {@code f}, returning a new function
* of type {@code (T) -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param i argument 2
* @param d argument 3
* @return a new function {@code (T t) -> double} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.ObjToDblE
rbind(ObjIntDblToDblE f, int i, double d) {
return (t) -> f.call(t, i, d);
}
/**
* Binds {@code (i, d)} to the end of {@code this}, returning a new function
* of type {@code (T) -> double}.
*
* @param i argument 2
* @param d argument 3
* @return a new function {@code (T t) -> double} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.ObjToDblE rbind(int i, double d) {
return ObjIntDblToDblE.rbind(this, i, d);
}
/**
* Binds {@code (t, i)} to the beginning of {@code f}, returning a new function
* of type {@code (double) -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param t argument 1
* @param i argument 2
* @return a new function {@code (double d) -> double} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.DblToDblE
bind(ObjIntDblToDblE f, T t, int i) {
return (d) -> f.call(t, i, d);
}
/**
* Binds {@code (t, i)} to the beginning of {@code this}, returning a new function
* of type {@code (double) -> double}.
*
* @param t argument 1
* @param i argument 2
* @return a new function {@code (double d) -> double} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.DblToDblE bind(T t, int i) {
return ObjIntDblToDblE.bind(this, t, i);
}
/**
* Binds {@code (d)} to the end of {@code f}, returning a new function
* of type {@code (T, int) -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param d argument 3
* @return a new function {@code (T t, int i) -> double} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.ObjIntToDblE
rbind(ObjIntDblToDblE f, double d) {
return (t, i) -> f.call(t, i, d);
}
/**
* Binds {@code (d)} to the end of {@code this}, returning a new function
* of type {@code (T, int) -> double}.
*
* @param d argument 3
* @return a new function {@code (T t, int i) -> double} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.ObjIntToDblE rbind(double d) {
return ObjIntDblToDblE.rbind(this, d);
}
/**
* Binds {@code (t, i, d)} to {@code f}, returning a new function
* of type {@code () -> double}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param t argument 1
* @param i argument 2
* @param d argument 3
* @return a new function {@code () -> double} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToDblE
bind(ObjIntDblToDblE f, T t, int i, double d) {
return () -> f.call(t, i, d);
}
/**
* Binds {@code (t, i, d)} to {@code this}, returning a new function
* of type {@code () -> double}.
*
* @param t argument 1
* @param i argument 2
* @param d argument 3
* @return a new function {@code () -> double} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToDblE bind(T t, int i, double d) {
return ObjIntDblToDblE.bind(this, t, i, d);
}
}