samples/codeinjection/src/org/apidesign/codeinjection/CountDownImplV1.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sun, 06 Oct 2013 22:05:14 +0200
changeset 407 e1439046d96e
permissions -rw-r--r--
Looks like scala change URLs of its releases
     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 }