org.jtheque.utils.count
Class Counter

java.lang.Object
  extended by org.jtheque.utils.count.Counter

public final class Counter
extends Object

A counter.

Author:
Baptiste Wicht

Constructor Summary
Counter()
           
 
Method Summary
 void add(int i)
          Add i to the counter.
 void clear()
          Clear the counter.
 void decrement()
          Decrement the counter of 1.
 int getValue()
          Return the current value of the counter.
 void increment()
          Increment the counter of 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
Method Detail

getValue

public int getValue()
Return the current value of the counter.

Returns:
The integer value of the counter.

increment

public void increment()
Increment the counter of 1.


decrement

public void decrement()
Decrement the counter of 1.


add

public void add(int i)
Add i to the counter.

Parameters:
i - The value to add.

clear

public void clear()
Clear the counter. This method set the current counter value to 0.



Copyright © 2010 JTheque. All Rights Reserved.