jtulach@303: /* jtulach@303: * To change this template, choose Tools | Templates jtulach@303: * and open the template in the editor. jtulach@303: */ jtulach@303: jtulach@303: package org.apidesign.codeinjection; jtulach@303: jtulach@303: /** The implementation of {@link CountDown} as of version 1.0. jtulach@303: * The {@link #down()} method always decrements by one. jtulach@303: * jtulach@303: * @author Jaroslav Tulach jtulach@303: * @since 1.0 jtulach@303: */ jtulach@303: final class CountDownImplV1 extends CountDown { jtulach@303: CountDownImplV1(int initial) { jtulach@303: this.cnt = initial; jtulach@303: } jtulach@303: jtulach@303: // BEGIN: codeinjection.v1 jtulach@303: private int cnt; jtulach@303: public void down() { jtulach@303: cnt--; jtulach@303: } jtulach@303: jtulach@303: public boolean isDown() { jtulach@303: return cnt <= 0; jtulach@303: } jtulach@303: // END: codeinjection.v1 jtulach@303: }