KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dso > concurrency > SimpleTrade


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package dso.concurrency;
5
6 /**
7  * Created by Alan Brown
8  * Date: May 17, 2005
9  * Time: 1:53:28 PM
10  */

11
12 public class SimpleTrade {
13
14     private int counter = 0;
15
16     public synchronized void incrementCounter () {
17     counter++;
18     }
19
20     public synchronized int getCounter() {
21         return counter;
22     }
23 }
24
Popular Tags