net.wimpi.modbus.util
Class AtomicCounter

java.lang.Object
  extended by net.wimpi.modbus.util.AtomicCounter

public class AtomicCounter
extends Object

Provides an atomic integer.

Version:
@version@ (@date@)
Author:
Dieter Wimberger (wimpi)

Constructor Summary
AtomicCounter()
          Constructs a new AtomicInteger.
AtomicCounter(int value)
          Constructs a new AtomicInteger with a given initial value.
 
Method Summary
 int get()
          Returns the value of this AtomicInteger.
 int increment()
          Increments this AtomicInteger by one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomicCounter

public AtomicCounter()
Constructs a new AtomicInteger.


AtomicCounter

public AtomicCounter(int value)
Constructs a new AtomicInteger with a given initial value.

Parameters:
value - the initial value.
Method Detail

increment

public int increment()
Increments this AtomicInteger by one.

Returns:
the resulting value.

get

public int get()
Returns the value of this AtomicInteger.

Returns:
the actual value.


Copyright © 2010. All Rights Reserved.