com.rathravane.till.data.serialNumberGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silt Show documentation
Show all versions of silt Show documentation
A small collection of classes used in various Rathravane systems.
package com.rathravane.till.data;
/**
* Generate serial numbers.
* @author peter
*
*/
public class serialNumberGenerator
{
public serialNumberGenerator ()
{
this ( "" );
}
public serialNumberGenerator ( String prefix )
{
this ( prefix, 1 );
}
public serialNumberGenerator ( long startAt )
{
this ( "", startAt );
}
public serialNumberGenerator ( String prefix, long startAt )
{
fNext = startAt;
fPrefix = prefix;
}
public synchronized String getNext ()
{
return fPrefix + (fNext++);
}
private final String fPrefix;
private long fNext;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy