Question: Primitives functioanl classes

Boaz Nahum boaznahum at gmail.com
Mon Nov 19 00:43:22 PST 2012


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);


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


Thanks
Boaz


More information about the lambda-dev mailing list