Package helma.objectmodel.dom
Class XmlIDGenerator
- java.lang.Object
-
- helma.objectmodel.dom.XmlIDGenerator
-
public class XmlIDGenerator extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description XmlIDGenerator()
Builds a new IDGenerator starting with 0.XmlIDGenerator(long value)
Builds a new IDGenerator starting with value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XmlIDGenerator
getIDGenerator(java.io.File file)
Read an IDGenerator from filelong
getValue()
Get the current counter valuejava.lang.String
newID()
Delivers a unique id and increases counter by 1.static void
saveIDGenerator(XmlIDGenerator idgen, java.io.File file)
Save an id generator to a file.protected void
setValue(long value)
Set the counter to a new valuejava.lang.String
toString()
Returns a string representation of this IDGenerator
-
-
-
Method Detail
-
newID
public java.lang.String newID()
Delivers a unique id and increases counter by 1.
-
setValue
protected void setValue(long value)
Set the counter to a new value
-
getValue
public long getValue()
Get the current counter value
-
toString
public java.lang.String toString()
Returns a string representation of this IDGenerator- Overrides:
toString
in classjava.lang.Object
-
getIDGenerator
public static XmlIDGenerator getIDGenerator(java.io.File file) throws ObjectNotFoundException
Read an IDGenerator from file- Parameters:
file
-- Returns:
- Throws:
ObjectNotFoundException
-
saveIDGenerator
public static void saveIDGenerator(XmlIDGenerator idgen, java.io.File file) throws java.io.IOException
Save an id generator to a file.- Parameters:
idgen
-file
-- Throws:
java.io.IOException
-
-