001package org.cpsolver.ifs.util; 002 003/** 004 * ID generator. 005 * 006 * @author Tomáš Müller 007 * @version IFS 1.3 (Iterative Forward Search)<br> 008 * Copyright (C) 2006 - 2014 Tomáš Müller<br> 009 * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br> 010 * <a href="http://muller.unitime.org">http://muller.unitime.org</a><br> 011 * <br> 012 * This library is free software; you can redistribute it and/or modify 013 * it under the terms of the GNU Lesser General Public License as 014 * published by the Free Software Foundation; either version 3 of the 015 * License, or (at your option) any later version. <br> 016 * <br> 017 * This library is distributed in the hope that it will be useful, but 018 * WITHOUT ANY WARRANTY; without even the implied warranty of 019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 020 * Lesser General Public License for more details. <br> 021 * <br> 022 * You should have received a copy of the GNU Lesser General Public 023 * License along with this library; if not see 024 * <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>. 025 */ 026public class IdGenerator { 027 private int iLastId = 0; 028 029 /** Generates new id 030 * @return new unique id 031 **/ 032 public long newId() { 033 return ++iLastId; 034 } 035 036}