2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package org.apidesign.codeinjection;
8 /** API class that can counts a count down.
10 * @author Jaroslav Tulach <jtulach@netbeans.org>
13 // BEGIN: codeinjection.CountDown
14 public abstract class CountDown {
18 public static CountDown create(int initial) {
19 return createSimpleImplementation(initial);
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 // FINISH: codeinjection.CountDown
28 private static CountDown createSimpleImplementation(int initial) {
29 return new CountDownImplV1(initial);