Question: Primitives functioanl classes
Paul Sandoz
paul.sandoz at oracle.com
Mon Nov 19 01:16:39 PST 2012
On Nov 19, 2012, at 9:43 AM, Boaz Nahum <boaznahum at gmail.com> wrote:
> I see that in some cases you preserve the original method name
>
> IntUnaryOperator {
>
> public default Integer operate(Integer operand) { return operate((int)
> operand); }
>
> public int operate(int operand);
> -----------------------------------------------------
> IntBlock {
> public default void accept(Integer t) { apply((int) t); }
>
> public void apply(int t);
>
There is a glitch in IntBlock we need to fix. The method names are inconsistent, it should be "accept(int i)".
>
> But in others, you introduce new method name:
>
> IntFunction {
>
> public default Integer apply(T t) { return applyAsInt(t); }
>
> public int applyAsInt(T t)
> -----------------------------------------------------
>
>
> IntSupplier {
>
> public default Integer get() { return getAsInt(); }
>
> public int getAsInt()
> -----------------------------------------------------
>
>
> What problems were caused when tried to persevere the original name in the
> last two examples
>
The return type is different.
Paul.
More information about the lambda-dev
mailing list