class AtomicFileCounter
extends java.lang.Object
Constructor and Description |
---|
AtomicFileCounter(java.lang.String path)
Create an instance of counter.
|
AtomicFileCounter(java.lang.String path,
int value)
Create an instance of counter and set its initial value.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Get value of the counter.
|
void |
setValue(int value)
Set value of the counter.
|
int |
tryDecrement()
If counter is positive then decrement it.
|
public AtomicFileCounter(java.lang.String path)
path
- path to the backing filejava.io.IOException
public AtomicFileCounter(java.lang.String path, int value) throws java.io.IOException
path
- path to the backing filevalue
- initial value of the counterjava.io.IOException
public int tryDecrement()
public int getValue()
public void setValue(int value)
value
- value of the counterCopyright © 2012–2017 Red Hat, Inc.. All rights reserved.