samples/sidemeanings/src/org/apidesign/sidemeanings/NonMixed.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
parent 208 897361847d12
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
jtulach@208
     1
package org.apidesign.sidemeanings;
jtulach@208
     2
jtulach@326
     3
import org.apidesign.sidemeanings.NonMixedFactory.Provider;
jtulach@326
     4
jtulach@208
     5
// BEGIN: sidemeanings.Mixed.Clean
jtulach@208
     6
public final class NonMixed {
jtulach@326
     7
    int counter;
jtulach@208
     8
    private int sum;
jtulach@208
     9
    private final Provider impl;
jtulach@208
    10
    
jtulach@326
    11
    NonMixed(Provider impl) {
jtulach@208
    12
        this.impl = impl;
jtulach@208
    13
    }
jtulach@208
    14
jtulach@208
    15
    public final int apiForClients() {
jtulach@208
    16
        int subclass = impl.toBeImplementedBySubclass();
jtulach@208
    17
        sum += subclass;
jtulach@208
    18
        return sum / counter;
jtulach@208
    19
    }
jtulach@208
    20
}
jtulach@208
    21
// END: sidemeanings.Mixed.Clean
jtulach@208
    22
jtulach@208
    23