org.apache.tapestry.util
Class IdAllocator

java.lang.Object
  extended byorg.apache.tapestry.util.IdAllocator

public class IdAllocator
extends java.lang.Object

Used to "uniquify" names within a given context. A base name is passed in, and the return value is the base name, or the base name extended with a suffix to make it unique.

Since:
3.0
Author:
Howard Lewis Ship

Constructor Summary
IdAllocator()
           
IdAllocator(java.lang.String namespace)
           
 
Method Summary
 java.lang.String allocateId(java.lang.String name)
          Allocates the id.
 void clear()
          Clears the allocator, resetting it to freshly allocated state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdAllocator

public IdAllocator()

IdAllocator

public IdAllocator(java.lang.String namespace)
Method Detail

allocateId

public java.lang.String allocateId(java.lang.String name)
Allocates the id. Repeated calls for the same name will return "name", "name_0", "name_1", etc.


clear

public void clear()
Clears the allocator, resetting it to freshly allocated state.