author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Fri, 03 Apr 2020 16:32:36 +0200 | |
changeset 416 | 9ed8788a1a4e |
permissions | -rw-r--r-- |
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
6 package org.apidesign.codeinjection;
8 /** The implementation of {@link CountDown} as of version 1.0.
9 * The {@link #down()} method always decrements by one.
10 *
11 * @author Jaroslav Tulach <jtulach@netbeans.org>
12 * @since 1.0
13 */
14 final class CountDownImplV1 extends CountDown {
15 CountDownImplV1(int initial) {
16 this.cnt = initial;
17 }
19 // BEGIN: codeinjection.v1
20 private int cnt;
21 public void down() {
22 cnt--;
23 }
25 public boolean isDown() {
26 return cnt <= 0;
27 }
28 // END: codeinjection.v1
29 }