1   package example;
2   
3   /**
4    * A very simple class to test
5    * @author vesal
6    */
7   public class Incrementer {
8   
9       int n;
10      
11      /**
12       * Initialize the incrementer
13       * @example <pre name="testNoCode"> Incrementer inc = new Incrementer(); inc.getCount() === 0; </pre> // this does not generate code
14       * @example <pre name="test"> 
15       *   Incrementer inc = new Incrementer(); 
16       *   inc.getCount() === 0; 
17       * </pre> 
18       */
19      public Incrementer() {
20          n = 0;
21      }
22  
23      
24      /**
25       * Increment the value by one
26       * @example
27       * <pre name="test">
28       *   Incrementer inc = new Incrementer();
29       *   inc.inc(); inc.getCount() === 1;
30       *   inc.inc(); inc.getCount() === 2;
31       *   inc.inc(); inc.getCount() === 3;
32       * </pre>
33       */
34      public void inc() {
35          n++;
36      }
37  
38      
39      /**
40       * @return current value
41       * @example <pre name="test">
42       *   Incrementer inc = new Incrementer(); inc.getCount() === 0;
43       * </pre> // this must be on itse own line
44       */
45      public int getCount() {
46          return n;
47      }
48      
49  }
50