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

rs.data.file.util.IntKeyGenerator Maven / Gradle / Ivy

The newest version!
/*
 * This file is part of RS Library (Data File Library).
 *
 *  RS Library is free software: you can redistribute it 
 *  and/or modify it under the terms of version 3 of the GNU 
 *  Lesser General Public  License as published by the Free Software 
 *  Foundation.
 *  
 *  RS Library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public 
 *  License along with RS Library.  If not, see 
 *  .
 */
package rs.data.file.util;


/**
 * A number generator for int.
 * @author ralph
 *
 */
public class IntKeyGenerator implements IKeyGenerator {

	/**
	 * The last generated ID.
	 */
	private int lastKey = 0;
	
	/**
	 * Constructor.
	 */
	public IntKeyGenerator() {
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Integer getNewId() {
		lastKey++;
		return lastKey;
	}

	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy