net.mintern.functions.ternary.checked.LongObjIntToLongE 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, U, int) -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface LongObjIntToLongE {
/**
* Performs this operation.
*
* @param l argument 1
* @param u argument 2
* @param i argument 3
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
long call(long l, U u, int i) throws E;
/**
* Binds {@code (l)} to the beginning of {@code f}, returning a new function
* of type {@code (U, int) -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @return a new function {@code (U u, int i) -> long} that calls
* {@code f.call(l, u, i)} and returns the result.
*/
static net.mintern.functions.binary.checked.ObjIntToLongE
bind(LongObjIntToLongE f, long l) {
return (u, i) -> f.call(l, u, i);
}
/**
* Binds {@code (l)} to the beginning of {@code this}, returning a new function
* of type {@code (U, int) -> long}.
*
* @param l argument 1
* @return a new function {@code (U u, int i) -> long} that calls
* {@code this.call(l, u, i)} and returns the result.
*/
default net.mintern.functions.binary.checked.ObjIntToLongE bind(long l) {
return LongObjIntToLongE.bind(this, l);
}
/**
* Binds {@code (u, i)} to the end of {@code f}, returning a new function
* of type {@code (long) -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param u argument 2
* @param i argument 3
* @return a new function {@code (long l) -> long} that calls
* {@code f.call(l, u, i)} and returns the result.
*/
static net.mintern.functions.unary.checked.LongToLongE
rbind(LongObjIntToLongE f, U u, int i) {
return (l) -> f.call(l, u, i);
}
/**
* Binds {@code (u, i)} to the end of {@code this}, returning a new function
* of type {@code (long) -> long}.
*
* @param u argument 2
* @param i argument 3
* @return a new function {@code (long l) -> long} that calls
* {@code this.call(l, u, i)} and returns the result.
*/
default net.mintern.functions.unary.checked.LongToLongE rbind(U u, int i) {
return LongObjIntToLongE.rbind(this, u, i);
}
/**
* Binds {@code (l, u)} to the beginning of {@code f}, returning a new function
* of type {@code (int) -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @param u argument 2
* @return a new function {@code (int i) -> long} that calls
* {@code f.call(l, u, i)} and returns the result.
*/
static net.mintern.functions.unary.checked.IntToLongE
bind(LongObjIntToLongE f, long l, U u) {
return (i) -> f.call(l, u, i);
}
/**
* Binds {@code (l, u)} to the beginning of {@code this}, returning a new function
* of type {@code (int) -> long}.
*
* @param l argument 1
* @param u argument 2
* @return a new function {@code (int i) -> long} that calls
* {@code this.call(l, u, i)} and returns the result.
*/
default net.mintern.functions.unary.checked.IntToLongE bind(long l, U u) {
return LongObjIntToLongE.bind(this, l, u);
}
/**
* Binds {@code (i)} to the end of {@code f}, returning a new function
* of type {@code (long, U) -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param i argument 3
* @return a new function {@code (long l, U u) -> long} that calls
* {@code f.call(l, u, i)} and returns the result.
*/
static net.mintern.functions.binary.checked.LongObjToLongE
rbind(LongObjIntToLongE f, int i) {
return (l, u) -> f.call(l, u, i);
}
/**
* Binds {@code (i)} to the end of {@code this}, returning a new function
* of type {@code (long, U) -> long}.
*
* @param i argument 3
* @return a new function {@code (long l, U u) -> long} that calls
* {@code this.call(l, u, i)} and returns the result.
*/
default net.mintern.functions.binary.checked.LongObjToLongE rbind(int i) {
return LongObjIntToLongE.rbind(this, i);
}
/**
* Binds {@code (l, u, i)} to {@code f}, returning a new function
* of type {@code () -> long}.
*
* @param the type of argument 2
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param l argument 1
* @param u argument 2
* @param i argument 3
* @return a new function {@code () -> long} that calls
* {@code f.call(l, u, i)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToLongE
bind(LongObjIntToLongE f, long l, U u, int i) {
return () -> f.call(l, u, i);
}
/**
* Binds {@code (l, u, i)} to {@code this}, returning a new function
* of type {@code () -> long}.
*
* @param l argument 1
* @param u argument 2
* @param i argument 3
* @return a new function {@code () -> long} that calls
* {@code this.call(l, u, i)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToLongE bind(long l, U u, int i) {
return LongObjIntToLongE.bind(this, l, u, i);
}
}