samples/codeinjection/src/org/apidesign/codeinjection/CountDownImplV1.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 
     6 package org.apidesign.codeinjection;
     7 
     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     }
    18     
    19 // BEGIN: codeinjection.v1
    20     private int cnt;
    21     public void down() {
    22         cnt--;
    23     }
    24 
    25     public boolean isDown() {
    26         return cnt <= 0;
    27     }
    28 // END: codeinjection.v1
    29 }