| java.lang.Object org.apache.tapestry.ioc.internal.util.IdAllocator
IdAllocator | final public class IdAllocator (Code) | | 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.
This class is not threadsafe.
|
Constructor Summary | |
public | IdAllocator() Creates a new allocator with no namespace. | public | IdAllocator(String namespace) Creates a new allocator with the provided namespace. |
Method Summary | |
public String | allocateId(String name) Allocates the id. | public void | clear() Clears the allocator, resetting it to freshly allocated state. | public IdAllocator | clone() Creates a clone of this IdAllocator instance, copying the allocator's namespace and key map. | public List<String> | getAllocatedIds() Returns a list of all allocated ids, sorted alphabetically. | public boolean | isAllocated(String name) Checks to see if a given name has been allocated. |
IdAllocator | public IdAllocator()(Code) | | Creates a new allocator with no namespace.
|
IdAllocator | public IdAllocator(String namespace)(Code) | | Creates a new allocator with the provided namespace.
|
allocateId | public String allocateId(String name)(Code) | | Allocates the id. Repeated calls for the same name will return "name", "name_0", "name_1",
etc.
|
clear | public void clear()(Code) | | Clears the allocator, resetting it to freshly allocated state.
|
clone | public IdAllocator clone()(Code) | | Creates a clone of this IdAllocator instance, copying the allocator's namespace and key map.
|
getAllocatedIds | public List<String> getAllocatedIds()(Code) | | Returns a list of all allocated ids, sorted alphabetically.
|
isAllocated | public boolean isAllocated(String name)(Code) | | Checks to see if a given name has been allocated.
|
|
|