litesoft
@ 947
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
// This Source Code is in the Public Domain per: http://unlicense.org package org.litesoft.core.util; public final class IDsource { private long sLastID = 0; // 0 will not be handed out (unless we wrap)! private long mDelta; public IDsource( long pDelta ) { mDelta = pDelta; } public IDsource() { this( 1 ); } public synchronized long nextID() { return sLastID += mDelta; } } |