ternary.checked.LongIntDblToObjE 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 (long, int, double) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface LongIntDblToObjE {
/**
* Performs this operation.
*
* @param l argument 1
* @param i argument 2
* @param d argument 3
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
R call(long l, int i, double d) throws E;
/**
* Binds {@code (l)} to the beginning of {@code f}, returning a new function
* of type {@code (int, double) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @return a new function {@code (int i, double d) -> R} that calls
* {@code f.call(l, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.IntDblToObjE
bind(LongIntDblToObjE f, long l) {
return (i, d) -> f.call(l, i, d);
}
/**
* Binds {@code (l)} to the beginning of {@code this}, returning a new function
* of type {@code (int, double) -> R}.
*
* @param l argument 1
* @return a new function {@code (int i, double d) -> R} that calls
* {@code this.call(l, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.IntDblToObjE bind(long l) {
return LongIntDblToObjE.bind(this, l);
}
/**
* Binds {@code (i, d)} to the end of {@code f}, returning a new function
* of type {@code (long) -> R}.
*
* @param the type of the return value
* @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 (long l) -> R} that calls
* {@code f.call(l, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.LongToObjE
rbind(LongIntDblToObjE f, int i, double d) {
return (l) -> f.call(l, i, d);
}
/**
* Binds {@code (i, d)} to the end of {@code this}, returning a new function
* of type {@code (long) -> R}.
*
* @param i argument 2
* @param d argument 3
* @return a new function {@code (long l) -> R} that calls
* {@code this.call(l, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.LongToObjE rbind(int i, double d) {
return LongIntDblToObjE.rbind(this, i, d);
}
/**
* Binds {@code (l, i)} to the beginning of {@code f}, returning a new function
* of type {@code (double) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @param i argument 2
* @return a new function {@code (double d) -> R} that calls
* {@code f.call(l, i, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.DblToObjE
bind(LongIntDblToObjE f, long l, int i) {
return (d) -> f.call(l, i, d);
}
/**
* Binds {@code (l, i)} to the beginning of {@code this}, returning a new function
* of type {@code (double) -> R}.
*
* @param l argument 1
* @param i argument 2
* @return a new function {@code (double d) -> R} that calls
* {@code this.call(l, i, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.DblToObjE bind(long l, int i) {
return LongIntDblToObjE.bind(this, l, i);
}
/**
* Binds {@code (d)} to the end of {@code f}, returning a new function
* of type {@code (long, int) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param d argument 3
* @return a new function {@code (long l, int i) -> R} that calls
* {@code f.call(l, i, d)} and returns the result.
*/
static net.mintern.functions.binary.checked.LongIntToObjE
rbind(LongIntDblToObjE f, double d) {
return (l, i) -> f.call(l, i, d);
}
/**
* Binds {@code (d)} to the end of {@code this}, returning a new function
* of type {@code (long, int) -> R}.
*
* @param d argument 3
* @return a new function {@code (long l, int i) -> R} that calls
* {@code this.call(l, i, d)} and returns the result.
*/
default net.mintern.functions.binary.checked.LongIntToObjE rbind(double d) {
return LongIntDblToObjE.rbind(this, d);
}
/**
* Binds {@code (l, i, d)} to {@code f}, returning a new function
* of type {@code () -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @param i argument 2
* @param d argument 3
* @return a new function {@code () -> R} that calls
* {@code f.call(l, i, d)} and returns the result.
*/
@SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
static net.mintern.functions.nullary.checked.NilToObjE
bind(LongIntDblToObjE f, long l, int i, double d) {
return () -> f.call(l, i, d);
}
/**
* Binds {@code (l, i, d)} to {@code this}, returning a new function
* of type {@code () -> R}.
*
* @param l argument 1
* @param i argument 2
* @param d argument 3
* @return a new function {@code () -> R} that calls
* {@code this.call(l, i, d)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToObjE bind(long l, int i, double d) {
return LongIntDblToObjE.bind(this, l, i, d);
}
}