com.neeve.lang
Class XAbstractPooledString<T extends XAbstractPooledString<T>>

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

public abstract class XAbstractPooledString<T extends XAbstractPooledString<T>>
extends XString
implements UtlPool.Item<T>

Abstract base class for pooled string types.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.neeve.lang.XString
XString.Factory<T extends XString>, XString.XStringFactory
 
Method Summary
 T acquire()
          Acquire a reference to this object.
 void dispose()
          Releases the reference count hold on this pooled string.
 int getOwnershipCount()
          Gets the current ownership count for the pooled string.
 UtlPool<T> getPool()
          Get a pool item's pool.
 T init()
          This method should not be called by user code, it is invoked by an object's pool when the object is recycled.
 T setPool(UtlPool<T> pool)
          This method should not be called by user code, it is invoked by a pooled strings's pool when the object is created.
 
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, 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
 

Method Detail

init

public final T init()
This method should not be called by user code, it is invoked by an object's pool when the object is recycled.

Specified by:
init in interface UtlPool.Item<T extends XAbstractPooledString<T>>
Returns:
Return 'this' object for method invocation chaining.

setPool

public final T setPool(UtlPool<T> pool)
This method should not be called by user code, it is invoked by a pooled strings's pool when the object is created.

Specified by:
setPool in interface UtlPool.Item<T extends XAbstractPooledString<T>>
Returns:
Return 'this' object for method invocation chaining.

getPool

public final UtlPool<T> getPool()
Description copied from interface: UtlPool.Item
Get a pool item's pool.

This method should return the pool set using UtlPool.Item.setPool(com.neeve.util.UtlPool)

Specified by:
getPool in interface UtlPool.Item<T extends XAbstractPooledString<T>>
Returns:
the pool set using UtlPool.Item.setPool(com.neeve.util.UtlPool)

acquire

public final T acquire()
Acquire a reference to this object.

An object's ownership count starts at 1.

Returns:
this pooled string for invocation chaining.

dispose

public final void dispose()
Releases the reference count hold on this pooled string.

This allows the pooled string to be returned to a pool (if it is pooled).


getOwnershipCount

public final int getOwnershipCount()
Gets the current ownership count for the pooled string.

Returns:
the current ownership count for the pooled string.


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