T - the type of the argument@FunctionalInterface public interface ObjToInt<T> extends ObjToIntE<T,RuntimeException>, ToIntFunction<T>
(T) -> int.| Modifier and Type | Method and Description |
|---|---|
default int |
applyAsInt(T t)
Allows
this to act as a ToIntFunction<T>. |
static <T> NilToInt |
bind(ObjToInt<T> f,
T t)
Binds
(t) to f, returning a new function
of type () -> int. |
default NilToInt |
bind(T t)
Binds
(t) to this, returning a new function
of type () -> int. |
static <T,E extends Exception> |
unchecked(Function<? super E,RuntimeException> toRuntime,
ObjToIntE<T,E> f)
Returns a wrapped version of
f that uses toRuntime to convert any checked
Exception to a RuntimeException. |
static <T,E extends Exception> |
unchecked(ObjToIntE<T,E> f)
Returns a wrapped version of
f that wraps any checked Exception with a
RuntimeException. |
static <T,E extends IOException> |
uncheckedIO(ObjToIntE<T,E> f)
|
static <T,E extends Exception> ObjToInt<T> unchecked(Function<? super E,RuntimeException> toRuntime, ObjToIntE<T,E> f)
f that uses toRuntime to convert any checked
Exception to a RuntimeException.T - the type of argument 1E - the Exception type that the operation may throwtoRuntime - if a checked exception is thrown from
ObjToIntE.call(T), then this function
is called in in order to convert it to a RuntimeExceptionf - the operation to wrapf that does not throw checked exceptionsstatic <T,E extends Exception> ObjToInt<T> unchecked(ObjToIntE<T,E> f)
f that wraps any checked Exception with a
RuntimeException.T - the type of argument 1E - the Exception type that the operation may throwf - the operation to wrapf that does not throw checked exceptionsstatic <T,E extends IOException> ObjToInt<T> uncheckedIO(ObjToIntE<T,E> f)
T - the type of argument 1E - the Exception type that the operation may throwf - the operation to wrapf that throws UncheckedIOException instead of
IOExceptionstatic <T> NilToInt bind(ObjToInt<T> f, T t)
(t) to f, returning a new function
of type () -> int.T - the type of the argumentf - the unbound functiont - the argument() -> int that calls
f.call(t) and returns the result.default NilToInt bind(T t)
(t) to this, returning a new function
of type () -> int.bind in interface ObjToIntE<T,RuntimeException>t - the argument() -> int that calls
this.call(t) and returns the result.default int applyAsInt(T t)
this to act as a ToIntFunction<T>.applyAsInt in interface ToIntFunction<T>t - the argumentCopyright © 2015. All rights reserved.