binary.checked.CharDblToByteE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-binary-extended Show documentation
Show all versions of functions-binary-extended Show documentation
Provides functional interfaces for most two-argument functions
package net.mintern.functions.binary.checked;
/**
* An operation of type {@code (char, double) -> byte}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface CharDblToByteE {
/**
* Performs this operation.
*
* @param ch argument 1
* @param d argument 2
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
byte call(char ch, double d) throws E;
/**
* Binds {@code (ch)} to the beginning of {@code f}, returning a new function
* of type {@code (double) -> byte}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param ch argument 1
* @return a new function {@code (double d) -> byte} that calls
* {@code f.call(ch, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.DblToByteE
bind(CharDblToByteE f, char ch) {
return (d) -> f.call(ch, d);
}
/**
* Binds {@code (ch)} to the beginning of {@code this}, returning a new function
* of type {@code (double) -> byte}.
*
* @param ch argument 1
* @return a new function {@code (double d) -> byte} that calls
* {@code this.call(ch, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.DblToByteE bind(char ch) {
return CharDblToByteE.bind(this, ch);
}
/**
* Binds {@code (d)} to the end of {@code f}, returning a new function
* of type {@code (char) -> byte}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param d argument 2
* @return a new function {@code (char ch) -> byte} that calls
* {@code f.call(ch, d)} and returns the result.
*/
static net.mintern.functions.unary.checked.CharToByteE
rbind(CharDblToByteE f, double d) {
return (ch) -> f.call(ch, d);
}
/**
* Binds {@code (d)} to the end of {@code this}, returning a new function
* of type {@code (char) -> byte}.
*
* @param d argument 2
* @return a new function {@code (char ch) -> byte} that calls
* {@code this.call(ch, d)} and returns the result.
*/
default net.mintern.functions.unary.checked.CharToByteE rbind(double d) {
return CharDblToByteE.rbind(this, d);
}
/**
* Binds {@code (ch, d)} to {@code f}, returning a new function
* of type {@code () -> byte}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param ch argument 1
* @param d argument 2
* @return a new function {@code () -> byte} that calls
* {@code f.call(ch, d)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToByteE
bind(CharDblToByteE f, char ch, double d) {
return () -> f.call(ch, d);
}
/**
* Binds {@code (ch, d)} to {@code this}, returning a new function
* of type {@code () -> byte}.
*
* @param ch argument 1
* @param d argument 2
* @return a new function {@code () -> byte} that calls
* {@code this.call(ch, d)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToByteE bind(char ch, double d) {
return CharDblToByteE.bind(this, ch, d);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy