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

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

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

public class AtomicCounterShort {

	private int currentMax = 0;
	
	
	public synchronized OptionalShort nextValue()
	{
		
		if( currentMax > 65535)
		{
			return new OptionalShort(false,(short)0);
		}
		else
		{
			short temp = (short) currentMax;
			currentMax++;
			
			return new OptionalShort(true,temp);
		}
		
		
		
		
	}
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy