ubiware.util
Class UniqueInstanceGenerator

java.lang.Object
  extended by ubiware.util.Counter
      extended by ubiware.util.UniqueInstanceGenerator
Direct Known Subclasses:
IDGenerator

public class UniqueInstanceGenerator
extends Counter

This class implements an ID generator, every time getNewID is called, a new uninque ID is generated. The id's are in the "http://www.ubiware.jyu.fi/id#" namespace

Since:
18.3.2010
Author:
Michael Cochez for UBIWARE project

Constructor Summary
UniqueInstanceGenerator(java.lang.String prefixForID, java.net.URI namespace)
          Create an IDGenerator which uses the given prefix.
 
Method Summary
 java.lang.String getNewID()
          Returns a new unique ID.
 Resource getNewResource()
           
 
Methods inherited from class ubiware.util.Counter
getNextNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueInstanceGenerator

public UniqueInstanceGenerator(java.lang.String prefixForID,
                               java.net.URI namespace)
Create an IDGenerator which uses the given prefix.

Parameters:
prefixForID - the prefix for the IDs
Method Detail

getNewResource

public Resource getNewResource()

getNewID

public java.lang.String getNewID()
Returns a new unique ID.

Returns:
the ID