1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/codeinjection/src/org/apidesign/codeinjection/CountDownImplV1.java Sun Oct 06 22:05:14 2013 +0200
1.3 @@ -0,0 +1,29 @@
1.4 +/*
1.5 + * To change this template, choose Tools | Templates
1.6 + * and open the template in the editor.
1.7 + */
1.8 +
1.9 +package org.apidesign.codeinjection;
1.10 +
1.11 +/** The implementation of {@link CountDown} as of version 1.0.
1.12 + * The {@link #down()} method always decrements by one.
1.13 + *
1.14 + * @author Jaroslav Tulach <jtulach@netbeans.org>
1.15 + * @since 1.0
1.16 + */
1.17 +final class CountDownImplV1 extends CountDown {
1.18 + CountDownImplV1(int initial) {
1.19 + this.cnt = initial;
1.20 + }
1.21 +
1.22 +// BEGIN: codeinjection.v1
1.23 + private int cnt;
1.24 + public void down() {
1.25 + cnt--;
1.26 + }
1.27 +
1.28 + public boolean isDown() {
1.29 + return cnt <= 0;
1.30 + }
1.31 +// END: codeinjection.v1
1.32 +}