diff --git a/nbproject/project.properties b/nbproject/project.properties index 5a47cde..e15010c 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,4 +1,4 @@ -#Mon, 09 Oct 2017 22:37:48 +0200 +#Tue, 10 Oct 2017 11:01:16 +0200 annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= diff --git a/src/sesim/IDGenerator.java b/src/sesim/IDGenerator.java index 63cad4b..4c6fa30 100644 --- a/src/sesim/IDGenerator.java +++ b/src/sesim/IDGenerator.java @@ -33,6 +33,7 @@ package sesim; public class IDGenerator { private long next_id; + private long start_id; /** * Initialize the ID generator @@ -40,7 +41,8 @@ public class IDGenerator { * @param start ID value to start with */ public IDGenerator(long start) { - next_id = start; + start_id=start; + reset(); } /** @@ -49,6 +51,13 @@ public class IDGenerator { public IDGenerator() { this(0); } + + /** + * Reset the ID generator + */ + public final void reset(){ + next_id = start_id; + } /** * Get the next ID