|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.lang.XString.XStringFactory
public static final class XString.XStringFactory
A. factory for XString
s which does not support pooling or preallocation.
Field Summary |
---|
Fields inherited from interface com.neeve.lang.XString.Factory |
---|
PROP_INITIAL_LENGTH, PROP_NATIVE, PROP_POOL_PREALLOCATE_COUNT, PROP_POOL_THREADED, PROP_POOLED |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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
instead
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)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 create
XString
.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
.public final XString create(String initialValue, 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>
initialValue
- The string value to assign to the XString
.mutable
- Whether or not the XString
supports mutation.
XString
public final XString create(XString initialValue, 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>
initialValue
- The string value to assign to the XString
.mutable
- Whether or not the XString
supports mutation.
XString
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |