|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.util.IdAllocator
public class IdAllocator
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.
Constructor Summary | |
---|---|
IdAllocator()
|
|
IdAllocator(String namespace)
|
Method Summary | |
---|---|
String |
allocateId(String name)
Allocates the id. |
void |
clear()
Clears the allocator, resetting it to freshly allocated state. |
static IdAllocator |
fromExternalString(String seed)
|
String |
peekNextId(String name)
Should return the exact same thing as allocateId(String) , with the difference
that the calculated id is not allocated and stored so multiple calls will always return the
same thing. |
String |
toExternalString()
Creates a custom string representation of the current state of this instance, capable of being re-created by using the corresponding fromExternalString(String) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IdAllocator()
public IdAllocator(String namespace)
Method Detail |
---|
public String allocateId(String name)
name
- The base id to allocate new unique ids from.
public String peekNextId(String name)
allocateId(String)
, with the difference
that the calculated id is not allocated and stored so multiple calls will always return the
same thing.
name
- The name to peek at.
public String toExternalString()
fromExternalString(String)
method.
public void clear()
public static IdAllocator fromExternalString(String seed)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |