ternary.checked.ObjIntDblToIntE 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) -> int}.
*
* @param the type of argument 1
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ObjIntDblToIntE {
/**
* 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
*/
int 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) -> int}.
*
* @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) -> int} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.IntDblToIntE
bind(ObjIntDblToIntE 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) -> int}.
*
* @param t argument 1
* @return a new function {@code (int i, double d) -> int} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.IntDblToIntE bind(T t) {
return ObjIntDblToIntE.bind(this, t);
}
/**
* Binds {@code (i, d)} to the end of {@code f}, returning a new function
* of type {@code (T) -> int}.
*
* @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) -> int} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.ObjToIntE
rbind(ObjIntDblToIntE 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) -> int}.
*
* @param i argument 2
* @param d argument 3
* @return a new function {@code (T t) -> int} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.ObjToIntE rbind(int i, double d) {
return ObjIntDblToIntE.rbind(this, i, d);
}
/**
* Binds {@code (t, i)} to the beginning of {@code f}, returning a new function
* of type {@code (double) -> int}.
*
* @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) -> int} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.DblToIntE
bind(ObjIntDblToIntE 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) -> int}.
*
* @param t argument 1
* @param i argument 2
* @return a new function {@code (double d) -> int} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.DblToIntE bind(T t, int i) {
return ObjIntDblToIntE.bind(this, t, i);
}
/**
* Binds {@code (d)} to the end of {@code f}, returning a new function
* of type {@code (T, int) -> int}.
*
* @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) -> int} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.ObjIntToIntE
rbind(ObjIntDblToIntE 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) -> int}.
*
* @param d argument 3
* @return a new function {@code (T t, int i) -> int} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.ObjIntToIntE rbind(double d) {
return ObjIntDblToIntE.rbind(this, d);
}
/**
* Binds {@code (t, i, d)} to {@code f}, returning a new function
* of type {@code () -> int}.
*
* @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 () -> int} that calls
* {@code f.call(t, i, d)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToIntE
bind(ObjIntDblToIntE 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 () -> int}.
*
* @param t argument 1
* @param i argument 2
* @param d argument 3
* @return a new function {@code () -> int} that calls
* {@code this.call(t, i, d)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToIntE bind(T t, int i, double d) {
return ObjIntDblToIntE.bind(this, t, i, d);
}
}