org.eclipse.wst.jsdt.chromium.debug.core.util

## Class UniqueKeyGenerator

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.debug.core.util.UniqueKeyGenerator

    public class UniqueKeyGenerator
    extends java.lang.Object

A utility class that is used to generate a unique key according to a proposed key and taking alternative keys if that one is already taken.

### Nested Class Summary

Nested Classes
`static interface` `UniqueKeyGenerator.Factory<E>` A factory for an abstract storage used in `#createElementWithUniqueName` method.

### Constructor Summary

Constructors
Constructor and Description
`UniqueKeyGenerator()`

### Method Summary

All Methods Static Methods Concrete Methods
`static <E> E` `createUniqueKey(java.lang.String proposedKey, int tryLimit, UniqueKeyGenerator.Factory<E> factory)` A general purpose algorithm that creates a unique key in an abstract storage and returns a corresponding element (of type E).

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### UniqueKeyGenerator

    public UniqueKeyGenerator()

### Method Detail

#### createUniqueKey

    public static <E> E createUniqueKey(java.lang.String proposedKey,
                                        int tryLimit,
                                        UniqueKeyGenerator.Factory<E> factory)

A general purpose algorithm that creates a unique key in an abstract storage and returns a corresponding element (of type E). It simply tries various keys that start with proposed string until succeeds or gives up.