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

ilex.util.SimpleCounter Maven / Gradle / Ivy

Go to download

A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.

The newest version!
/*
*  $Id$
*/
package ilex.util;

/**
* Interface for implementing persistent counters used for Unique IDs.
*/
public class SimpleCounter implements Counter
{
	private int nextValue;

	public SimpleCounter(int initValue)
	{
		setNextValue(initValue);
	}

	/**
	* @return the next integer value and increments the counter.
	*/
	public int getNextValue( )
	{
		return nextValue++;
	}

	/**
	* Sets the counter so that the next call to getNextValue() will return
	* the passed integer.
	* @param value next value to return.
	*/
	public void setNextValue( int value )
	{
		nextValue = value;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy