T - The type of the concrete XString or subclasspublic interface IXStringFactory<T extends XString>
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_INITIAL_CAPACITY
Property name used to control the initial capacity of backing storage for strings created by a factory.
|
static String |
PROP_POOL_PREALLOCATE_COUNT
Property indicating whether or not the pool backing the factory should preallocate XStrings to avoid
object promotion at runtime.
|
static String |
PROP_POOL_THREADED
Property indicating whether or not the pool backing the factory is a thread safe.
|
static String |
PROP_POOLED
Property indicating whether or not the factory is backed by a pool.
|
| Modifier and Type | Method and Description |
|---|---|
T |
create()
Create an empty, mutable
XString possibly from a backing pool. |
T |
create(boolean mutable)
Create an empty
XString possibly from a backing pool. |
T |
create(String value)
Creates an immutable
XString, possibly from a backing pool, from the given String value. |
T |
create(String initialValue,
boolean mutable)
Creates an
XString possibly from a backing pool. |
T |
create(XString initialValue,
boolean mutable)
Creates an
XString possibly from a backing pool. |
T[] |
createArray(int size)
Create an array of
XStrings |
static final String PROP_INITIAL_CAPACITY
XStrings do not allocate the backing storage until a value is set in it. Subsequent changes in
the XString value will dynamicaly resize the backing storage if need be. The backing storage
initial capacity specifies the minimum size of the storage to allocate on the first allocation. This
property should be configured if the XStrings created by this factory is expected to undergo
several value changes of a variety of sizes. In such a case, this property should be set as the upper
bound of the set of values expected to be set so the backing storage does not go through excesive
resizing
static final String PROP_POOLED
This Property applies to Factorys for XString subclasses that support pooling.
static final String PROP_POOL_THREADED
This Property applies to Factorys for XString subclasses that support pooling or preallocation.
static final String PROP_POOL_PREALLOCATE_COUNT
This Property only applies to Factorys for XString subclasses that support preallocation
T create()
XString possibly from a backing pool. When the the user is done with the XString,
dispose() should be called (if the the XString is a poolable type) to return the object to the pool.XString.T[] createArray(int size)
XStringssize - the size of the array to createT create(boolean mutable)
Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.