构造器和说明 |
---|
ConstantPool() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
exists(java.lang.String name)
|
protected abstract T |
newConstant(int id,
java.lang.String name) |
T |
newInstance(java.lang.String name)
|
int |
nextId()
已过时。
|
T |
valueOf(java.lang.Class<?> firstNameComponent,
java.lang.String secondNameComponent)
|
T |
valueOf(java.lang.String name)
Returns the
Constant which is assigned to the specified name . |
public T valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
public T valueOf(java.lang.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 Constant
public boolean exists(java.lang.String name)
public T newInstance(java.lang.String name)
protected abstract T newConstant(int id, java.lang.String name)
@Deprecated public final int nextId()