Constants.
| Modifier and Type | Field and Description |
|---|---|
| private final ConcurrentMap | |
| private final AtomicInteger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private T | |
| public boolean | |
| private T | getOrCreate(String
the name of the name)ConstantGet existing constant by name or creates new one if not exists. |
| protected abstract T | |
| public T | newInstance(String name)
Creates a new |
| public final int | |
| public T | valueOf(Class<?> firstNameComponent, String secondNameComponent)
Shortcut of |
| public T |
| constants | back to summary |
|---|---|
| private final ConcurrentMap<String, T> constants | |
| nextId | back to summary |
|---|---|
| private final AtomicInteger nextId | |
| ConstantPool | back to summary |
|---|---|
| public ConstantPool() | |
| createOrThrow | back to summary |
|---|---|
| private T createOrThrow(String name) Creates constant by name or throws exception. Threadsafe | |
| exists | back to summary |
|---|---|
| public boolean exists(String name) Returns | |
| getOrCreate | back to summary |
|---|---|
| private T getOrCreate(String name) Get existing constant by name or creates new one if not exists. Threadsafe | |
| newConstant | back to summary |
|---|---|
| protected abstract T newConstant(int id, String name) | |
| newInstance | back to summary |
|---|---|
| public T newInstance(String name) Creates a new | |
| nextId | back to summary |
|---|---|
| public final int nextId()
Deprecated
| |
| valueOf | back to summary |
|---|---|
| public T valueOf(Class<?> firstNameComponent, String secondNameComponent) Shortcut of | |
| valueOf | back to summary |
|---|---|
| public T valueOf(String name) Returns the | |