Code example for AtomicLong

Methods: getAndIncrement

0
public class DoubleAsStringObjectFactory implements ObjectFactory<String> {
 
	private AtomicLong counter = new AtomicLong();
 
	public String instance() {
		return String.valueOf(Double.valueOf(counter.getAndIncrement()));
	} 
 
}