Constant to represent a reference to a UTF-8 encoded string.
The following system properties govern caching this class performs.
SYS_PROP_CACHE_MAX_ENTRIES (since 6.4): The size of the cache, by default 0, meaning caching is
disabled.SYS_PROP_CACHE_MAX_ENTRY_SIZE (since 6.0): The maximum size of the values to cache, by default 200, 0
disables caching. Values larger than this are not cached.SYS_PROP_STATISTICS (since 6.0): Prints statistics on the console when the JVM exits.Here is a sample Maven invocation with caching disabled:
mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=0 -Dbcel.maxcached=0
Here is a sample Maven invocation with caching enabled:
mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=100000 -Dbcel.maxcached=5000000
Constant
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static volatile int | |
| private static volatile int | |
| private static volatile int | |
| private static volatile int | |
| private static final String | |
| private static final String | |
| private static final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(final Visitor
Visitor object v)Implements abstract org. Implements org. |
| public static synchronized void | |
| pack-priv static synchronized void | |
| private static void | |
| public void | dump(final DataOutputStream
Output file stream file)Implements abstract org. |
| public String | |
| public static ConstantUtf8 | Returns: a new or cached instance of the given value.the value. value)Gets a new or cached instance of the given value. |
| public static ConstantUtf8 | Returns: a new or cached instance of the given value.the value. dataInput)Gets a new or cached instance of the given value. |
| public static ConstantUtf8 | Returns: a new or cached instance of the given value.the value. value)Gets a new or cached instance of the given value. |
| pack-priv static void | |
| public void | |
| public String | Returns: String representationOverrides org. |
| considered | back to summary |
|---|---|
| private static volatile int considered | |
| created | back to summary |
|---|---|
| private static volatile int created | |
| hits | back to summary |
|---|---|
| private static volatile int hits | |
| skipped | back to summary |
|---|---|
| private static volatile int skipped | |
| SYS_PROP_CACHE_MAX_ENTRIES | back to summary |
|---|---|
| private static final String SYS_PROP_CACHE_MAX_ENTRIES | |
| SYS_PROP_CACHE_MAX_ENTRY_SIZE | back to summary |
|---|---|
| private static final String SYS_PROP_CACHE_MAX_ENTRY_SIZE | |
| SYS_PROP_STATISTICS | back to summary |
|---|---|
| private static final String SYS_PROP_STATISTICS | |
| value | back to summary |
|---|---|
| private final String value | |
| ConstantUtf8 | back to summary |
|---|---|
| public ConstantUtf8(final ConstantUtf8 constantUtf8) Initializes from another object.
| |
| ConstantUtf8 | back to summary |
|---|---|
| pack-priv ConstantUtf8(final DataInput dataInput) throws IOException Initializes instance from file data.
| |
| ConstantUtf8 | back to summary |
|---|---|
public ConstantUtf8(final String value)
| |
| accept | back to summary |
|---|---|
| public void accept(final Visitor v) Implements abstract org. Implements org. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. | |
| clearCache | back to summary |
|---|---|
| public static synchronized void clearCache() Clears the cache.
| |
| clearStats | back to summary |
|---|---|
| pack-priv static synchronized void clearStats() | |
| countCreated | back to summary |
|---|---|
| private static void countCreated() | |
| dump | back to summary |
|---|---|
| public void dump(final DataOutputStream file) throws IOException Implements abstract org. Dumps String in Utf8 format to file stream.
| |
| getBytes | back to summary |
|---|---|
public String getBytes()
| |
| getCachedInstance | back to summary |
|---|---|
| public static ConstantUtf8 getCachedInstance(final String value) Gets a new or cached instance of the given value.
See
| |
| getInstance | back to summary |
|---|---|
| public static ConstantUtf8 getInstance(final DataInput dataInput) throws IOException Gets a new or cached instance of the given value.
See
| |
| getInstance | back to summary |
|---|---|
| public static ConstantUtf8 getInstance(final String value) Gets a new or cached instance of the given value.
See
| |
| printStats | back to summary |
|---|---|
| pack-priv static void printStats() | |
| setBytes | back to summary |
|---|---|
| public void setBytes(final String bytes)
Deprecated (since 6.0)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static final HashMap | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean |
| BCEL_STATISTICS | back to summary |
|---|---|
| private static final boolean BCEL_STATISTICS | |
| CACHE | back to summary |
|---|---|
| private static final HashMap<String, ConstantUtf8> CACHE | |
| INITIAL_CAPACITY | back to summary |
|---|---|
| private static final int INITIAL_CAPACITY | |
| MAX_ENTRIES | back to summary |
|---|---|
| private static final int MAX_ENTRIES | |
| MAX_ENTRY_SIZE | back to summary |
|---|---|
| private static final int MAX_ENTRY_SIZE | |
| Cache | back to summary |
|---|---|
| private Cache() | |
| isEnabled | back to summary |
|---|---|
| pack-priv static boolean isEnabled() | |