public static final class XString.XStringFactory extends Object implements XString.Factory<XString>
XString
s which does not support pooling or preallocation.PROP_INITIAL_LENGTH, PROP_NATIVE, PROP_POOL_PREALLOCATE_COUNT, PROP_POOL_THREADED, PROP_POOLED
Modifier and Type | Method and Description |
---|---|
XString |
create()
Returns an empty, mutable
XString possibly from a backing pool. |
XString |
create(boolean mutable)
Returns an empty
XString possibly from a backing pool. |
XString |
create(String value)
Creates an immutable
XString possibly from a backing pool. |
XString |
create(String initialValue,
boolean mutable)
Creates a
XString possibly from a backing pool. |
XString |
create(XString initialValue,
boolean mutable)
Creates a
XString possibly from a backing pool. |
XString[] |
createArray(int size)
Returns an array of mutable
XString possibly from a backing pool. |
boolean |
getIsNative() |
int |
getStringLength() |
static XString.Factory<? extends XString> |
newFactory(String name,
int stringLength,
boolean isNative)
Constructs a new Factory for
XString s. |
static XString.Factory<? extends XString> |
newFactory(String name,
int stringLength,
boolean pooled,
int preallocationCount,
boolean threaded,
boolean isNative)
Deprecated.
XStrings don't support pooling or preallocation. Use
XPooledString instead |
public static XString.Factory<? extends XString> newFactory(String name, int stringLength, boolean isNative)
XString
s.name
- A name unique to this factory type which is used to uniquely identify the underlying pool.stringLength
- The expected length of the string which is used to size its backing buffer. Specifying a value
of 0 indicates that a backing buffer should not be preallocated.isNative
- Whether or not the XString
s should use native backing buffers (when enabled/supported)@Deprecated public static XString.Factory<? extends XString> newFactory(String name, int stringLength, boolean pooled, int preallocationCount, boolean threaded, boolean isNative)
XPooledString
insteadXString
s.name
- A name unique to this factory type which is used to uniquely identify the underlying pool.stringLength
- The expected length of the string which is used to size its backing buffer. Specifying a value
of 0 indicates that a backing buffer should not be preallocated.isNative
- Whether or not the XString
s should use native backing buffers (when enabled/supported)pooled
- Whether or not to back the factory with a pool.preallocationCount
- The number of XString
to preallocate.threaded
- Whether or not the backing pool should be thread safe.public final boolean getIsNative()
public final int getStringLength()
public final XString create()
XString
possibly from a backing pool. When the
the user is done with the XString
, dispose() should be called, to
return it to the pool.create
in interface XString.Factory<XString>
XString
.public final XString[] createArray(int size)
XString
possibly from a backing pool. When the
the user is done with the array, dispose() should be called on each of the elements to return
return them to the pool.createArray
in interface XString.Factory<XString>
size
- the size of the array to createXString
.public final XString create(String value)
XString
possibly from a backing pool. When the
the user is done with the XString
, dispose() should be called, to
return it to the pool.create
in interface XString.Factory<XString>
value
- The string value to assign to the XString
.XString
public final XString create(boolean mutable)
XString
possibly from a backing pool. When the
the user is done with the XString
, dispose() should be called, to
return it to the pool.create
in interface XString.Factory<XString>
mutable
- Whether or not the XString
supports mutation (after
it is first set)XString
.Copyright © 2019 Neeve Research, LLC. All Rights Reserved.