samples/codeinjection/src/org/apidesign/codeinjection/CountDown.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 10 Jan 2009 21:29:22 +0100
changeset 303 77b6002451c4
child 398 b87fd959548b
permissions -rw-r--r--
Initial version of sample to explain 'code injection'
     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 /** API class that can counts a count down.
     9  *
    10  * @author Jaroslav Tulach <jtulach@netbeans.org>
    11  * @since 1.0
    12  */
    13 // BEGIN: codeinjection.CountDown
    14 public abstract class CountDown {
    15     CountDown() {
    16     }
    17 
    18     public static CountDown create(int initial) {
    19         return new CountDownImplV1(initial);
    20     }
    21 
    22     /** Decrements the counter */
    23     public abstract void down();
    24     /** @return true if the counter is 0 or less */
    25     public abstract boolean isDown();
    26 }
    27 // END: codeinjection.CountDown