T
- The type of the concrete XString or subclasspublic static interface XString.Factory<T extends XString>
Modifier and Type | Field and Description |
---|---|
static String |
PROP_INITIAL_LENGTH
Property name used to control the initial length (in UTF-8 encoded bytes)
of strings created by a factory.
|
static String |
PROP_NATIVE
Property name used to control whether or not strings created by
a factory are backed by native buffers.
|
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()
Returns an empty, mutable
XString possibly from a backing pool. |
T |
create(boolean mutable)
Returns 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) |
static final String PROP_INITIAL_LENGTH
Specifying a value of 0 will cause no backing buffer for the XString to be preallocated which can be useful for preventing object promotions at runtime.
If the XString is later initialized to a value large than the specified initial length a new backing buffer will be allocated to accommodate the larger size.
static final String PROP_NATIVE
static final String PROP_POOLED
This Property applies to XString.Factory
s for XString
subclasses that support pooling.
static final String PROP_POOL_THREADED
This Property applies to XString.Factory
s for XString
subclasses that support pooling or preallocation.
static final String PROP_POOL_PREALLOCATE_COUNT
This Property only applies to XString.Factory
s 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)
size
- the size of the array to createT create(boolean mutable)
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.