01: package com.etymon.pj.util;
02:
03: public class IntCounter {
04:
05: public IntCounter(int c) {
06: _c = c;
07: }
08:
09: public int value() {
10: return _c;
11: }
12:
13: public void set(int value) {
14: _c = value;
15: }
16:
17: public void inc() {
18: _c++;
19: }
20:
21: public void inc(int size) {
22: _c = _c + size;
23: }
24:
25: public void dec() {
26: _c--;
27: }
28:
29: public void dec(int size) {
30: _c = _c - size;
31: }
32:
33: int _c;
34:
35: }
|