jopt.js.spi.util
Class IDStore

java.lang.Object
  extended byjopt.js.spi.util.IDStore

public class IDStore
extends java.lang.Object

A class that is accessed statically to ensure that resource ids are all unique

Author:
James Boerkoel

Constructor Summary
IDStore()
           
 
Method Summary
static int generateUniqueID()
          Returns a unique ID that has not been used yet and registers the id as used
static boolean registerID(int id)
          A method to see if an id is valid (ie not used yet)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDStore

public IDStore()
Method Detail

registerID

public static boolean registerID(int id)
A method to see if an id is valid (ie not used yet)

Parameters:
id - id that we are verifying
Returns:
true if the id is available

generateUniqueID

public static int generateUniqueID()
Returns a unique ID that has not been used yet and registers the id as used

Returns:
a new unique ID