Package helma.objectmodel.dom

# Class XmlIDGenerator

java.lang.Object
helma.objectmodel.dom.XmlIDGenerator

public class XmlIDGenerator extends 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

Modifier and Type
Method
Description
`static XmlIDGenerator`
`getIDGenerator(File file)`
Read an IDGenerator from file
`long`
`getValue()`
Get the current counter value
`String`
`newID()`
Delivers a unique id and increases counter by 1.
`static void`
`saveIDGenerator(XmlIDGenerator idgen, File file)`
Save an id generator to a file.
`protected void`
`setValue(long value)`
Set the counter to a new value
`String`
`toString()`
Returns a string representation of this IDGenerator

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### XmlIDGenerator

public XmlIDGenerator()
Builds a new IDGenerator starting with 0.

### XmlIDGenerator

public XmlIDGenerator(long value)
Builds a new IDGenerator starting with value.

## Method Details

### newID

public 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 String toString()
Returns a string representation of this IDGenerator

Overrides:
  `toString` in class `Object`

### getIDGenerator

public static XmlIDGenerator getIDGenerator(File file) throws ObjectNotFoundException
Read an IDGenerator from file

Parameters:
  `file` -
Returns:
Throws:
  `ObjectNotFoundException`

### saveIDGenerator

public static void saveIDGenerator(XmlIDGenerator idgen, File file) throws IOException
Save an id generator to a file.

Parameters:
  `idgen` -
  `file` -
Throws:
  `IOException`