All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vmlens.trace.agent.bootstrap.AtomicCounter Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
package com.vmlens.trace.agent.bootstrap;

public class AtomicCounter {

	private int currentMax = 0;
	
	
	public synchronized OptionalByte nextValue()
	{
		
		if( currentMax > 255)
		{
			return new OptionalByte(false,(byte)0);
		}
		else
		{
			byte temp = (byte) currentMax;
			currentMax++;
			
			return new OptionalByte(true,temp);
		}
		
		
		
		
	}
	
	
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy