public class DefaultGenerator extends java.lang.Object implements GeneratorIF
Modifier and Type | Field and Description |
---|---|
protected long |
counterstart |
protected long |
currentversion |
protected static java.util.HashMap<java.lang.String,java.lang.Long> |
MAP |
protected java.util.Properties |
properties |
protected long |
step |
Constructor and Description |
---|
DefaultGenerator()
The default Constructor, no arguments given.
|
DefaultGenerator(java.util.Properties props)
Creates a Defaultgenerator with a given set of Properties.
|
Modifier and Type | Method and Description |
---|---|
long |
generate(java.lang.String namespace)
Creates a new entry for a namespace or, if already existant, increases
the number of this namespace
|
java.util.HashMap<java.lang.String,java.lang.Long> |
getMap()
Returns the HashMap containing the key-value pairs of the namespaces
|
void |
reset(java.lang.String namespace)
Resets a given namespace to the default
|
void |
reset(java.lang.String namespace,
long value)
(Re-)Sets a given namespace to the given value
|
protected void |
setProperties(java.util.Properties props)
Sets props to this Objects's Properties
|
protected static java.util.HashMap<java.lang.String,java.lang.Long> MAP
protected java.util.Properties properties
protected long currentversion
protected long step
protected long counterstart
public DefaultGenerator()
public DefaultGenerator(java.util.Properties props)
props
- protected void setProperties(java.util.Properties props)
props
- public void reset(java.lang.String namespace)
reset
in interface GeneratorIF
public void reset(java.lang.String namespace, long value)
reset
in interface GeneratorIF
value
- the new counter setting.public java.util.HashMap<java.lang.String,java.lang.Long> getMap()
getMap
in interface GeneratorIF
public long generate(java.lang.String namespace)
generate
in interface GeneratorIF
namespace
- The namespace to create/add