diff -r 000000000000 -r 77b6002451c4 samples/codeinjection/src/org/apidesign/codeinjection/CountDownImplV1.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/codeinjection/src/org/apidesign/codeinjection/CountDownImplV1.java Sat Jan 10 21:29:22 2009 +0100 @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.apidesign.codeinjection; + +/** The implementation of {@link CountDown} as of version 1.0. + * The {@link #down()} method always decrements by one. + * + * @author Jaroslav Tulach + * @since 1.0 + */ +final class CountDownImplV1 extends CountDown { + CountDownImplV1(int initial) { + this.cnt = initial; + } + +// BEGIN: codeinjection.v1 + private int cnt; + public void down() { + cnt--; + } + + public boolean isDown() { + return cnt <= 0; + } +// END: codeinjection.v1 +}