| 构造器和说明 |
|---|
ConstantPool() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
exists(String name)
Returns
true if exists for the given name. |
protected abstract T |
newConstant(int id,
String name) |
T |
newInstance(String name)
Creates a new
Constant for the given name or fail with an
IllegalArgumentException if a Constant for the given name exists. |
T |
valueOf(Class<?> firstNameComponent,
String secondNameComponent)
|
T |
valueOf(String name)
Returns the
Constant which is assigned to the specified name. |
public T valueOf(String name)
Constant which is assigned to the specified name.
If there's no such Constant, a new one will be created and returned.
Once created, the subsequent calls with the same name will always return the previously created one
(i.e. singleton.)name - the name of the Constantpublic boolean exists(String name)
true if exists for the given name.public T newInstance(String name)
Constant for the given name or fail with an
IllegalArgumentException if a Constant for the given name exists.Copyright © 2018. All rights reserved.