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