com.neeve.lang
Class XPooledString

java.lang.Object
  extended by com.neeve.lang.XString
      extended by com.neeve.lang.XAbstractPooledString<XPooledString>
          extended by com.neeve.lang.XPooledString
All Implemented Interfaces:
UtlPool.Item<XPooledString>, Appendable, CharSequence

public final class XPooledString
extends XAbstractPooledString<XPooledString>

Implements a poolable XString.

Note: This class is currently intended for internal use only.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.neeve.lang.XString
XString.XStringFactory
 
Field Summary
static XString.Factory<XPooledString> FACTORY
          The default factory used to create pooled string instances.
 
Method Summary
static XPooledString create()
          Create a new, mutable, uninitialized XPooledString using this type's default XString.Factory.
static XPooledString create(boolean mutable)
          Create a new, uninitialized XPooledString using this type's default XString.Factory.
static XPooledString create(String initialValue, boolean mutable)
          Create a new XPooledString initialized to the given value using this type's default XString.Factory.
static XPooledString create(XString initialValue, boolean mutable)
          Create a new XPooledString initialized to the given value using this type's default XString.Factory.
static XString.Factory<XPooledString> newFactory(String name, int stringLength, boolean pooled, int preallocationCount, boolean threaded, boolean isNative)
          Construct a new Factory for XPooledStrings.
static XString.Factory<XPooledString> newFactory(String name, Map<String,Object> props)
          Construct a new Factory for XPooledStrings.
 
Methods inherited from class com.neeve.lang.XAbstractPooledString
acquire, dispose, getOwnershipCount, getPool, init, setPool
 
Methods inherited from class com.neeve.lang.XString
append, append, append, append, append, append, append, append, append, append, append, charAt, clear, compareTo, copyFrom, copyFrom, copyFromMemory, copyFromNative, copyInto, copyInto, copyInto, copyInto, create, create, create, create, create, equals, getBackingBuffer, getBackingBufferOffset, getSerializedLength, getValue, getValueAsLong, getValueAsLong, getValueAsLongDecimal, hashCode, indexOf, indexOf, indexOf, indexOf, initialize, initializeFrom, isImmutable, isInitialized, isMutable, isNativeXStringEnabled, isNull, length, reset, setCharAt, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromMemory, startsWith, startsWith, subSequence, toDiagnosticString, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FACTORY

public static final XString.Factory<XPooledString> FACTORY
The default factory used to create pooled string instances.

Method Detail

newFactory

public static XString.Factory<XPooledString> newFactory(String name,
                                                        int stringLength,
                                                        boolean pooled,
                                                        int preallocationCount,
                                                        boolean threaded,
                                                        boolean isNative)
Construct a new Factory for XPooledStrings.

Parameters:
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.
isNative - Whether or not the XPooledStrings should use native backing buffers (when enabled/supported)
pooled - Whether or not to back the factory with a pool.
preallocationCount - The number of XPooledString to preallocate.
threaded - Whether or not the backing pool should be thread safe.
Returns:
A new Factory.

newFactory

public static XString.Factory<XPooledString> newFactory(String name,
                                                        Map<String,Object> props)
Construct a new Factory for XPooledStrings.

See XString.Factory for a listing of property names.

Parameters:
name - A name unique to this factory type which is used to uniquely identify the underlying pool.
props - Properties used to configure the Factory.
Returns:
A new Factory.

create

public static final XPooledString create()
Create a new, mutable, uninitialized XPooledString using this type's default XString.Factory.

Returns:
a new, uninitialized XPooledString.

create

public static final XPooledString create(boolean mutable)
Create a new, uninitialized XPooledString using this type's default XString.Factory.

Parameters:
mutable - Whether the returned XPooledString is mutable
Returns:
a new, uninitialized XPooledString.

create

public static final XPooledString create(String initialValue,
                                         boolean mutable)
Create a new XPooledString initialized to the given value using this type's default XString.Factory.

This method does not preallocate the backing buffer. The caller may call XString.getBackingBuffer() on the returned string to create the backing buffer based on the lenght of the initial value.

Parameters:
mutable - Whether the returned XPooledString is mutable
initialValue - the initial String value for the new XPooledString.
Returns:
a new SocialSecurityNumber initialized to the given value

create

public static final XPooledString create(XString initialValue,
                                         boolean mutable)
Create a new XPooledString initialized to the given value using this type's default XString.Factory.

Parameters:
mutable - Whether the returned XPooledString is mutable
initialValue - the initial String value for the new XPooledString.
Returns:
a new SocialSecurityNumber initialized to the given value


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.