public abstract class StringMeter extends Object
String| Modifier and Type | Field and Description |
|---|---|
static boolean |
ENABLED
Enable or disable string optimization through the
org.github.jamm.string.Optimize String system property. |
static long |
STRING_SHALLOW_SIZE
The String shallow size stored as a constant to have it compiled directly into the measure method.
|
| Constructor and Description |
|---|
StringMeter() |
| Modifier and Type | Method and Description |
|---|---|
long |
measureDeep(MemoryMeterStrategy strategy,
String s)
Measure the deep size of the specified String.
|
protected abstract long |
measureStringValue(MemoryMeterStrategy strategy,
String s)
Measure the size of the value of the specified String.
|
static StringMeter |
newInstance()
Creates a new
StringMeter instance. |
public static final boolean ENABLED
org.github.jamm.string.Optimize String system property. true by default.public static final long STRING_SHALLOW_SIZE
public long measureDeep(MemoryMeterStrategy strategy, String s)
strategy - the strategy to perform the measurements - the stringprotected abstract long measureStringValue(MemoryMeterStrategy strategy, String s)
strategy - the strategy to perform the measurements - the stringpublic static StringMeter newInstance()
StringMeter instance.StringMeter instance.Copyright © 2023. All rights reserved.