com.neeve.util
Class UtlPlist.Element<T>

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.util.UtlPlist.Element<T>
All Implemented Interfaces:
UtlPool.Item<UtlPlist.Element<T>>
Enclosing class:
UtlPlist<T>

public static class UtlPlist.Element<T>
extends UtlListElement
implements UtlPool.Item<UtlPlist.Element<T>>

The default element class.

The plist maintains an internal list into which it links element objects that indirect to user objects. This class is the default element object used by the plist. The user can extend this class to add its own meta fields or specify that this class be used as is as the list element.


Field Summary
 
Fields inherited from class com.neeve.util.UtlListElement
count, head, next, prev
 
Method Summary
 T getObject()
          Get the user object
 UtlPool<UtlPlist.Element<T>> getPool()
          Get a pool item's pool.
 UtlPlist.Element<T> init()
          Initialize an item.
 UtlPlist.Element<T> setObject(T object)
           
 UtlPlist.Element<T> setPool(UtlPool<UtlPlist.Element<T>> pool)
          Set a pool item's pool.
 
Methods inherited from class com.neeve.util.UtlListElement
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setObject

public final UtlPlist.Element<T> setObject(T object)

getObject

public final T getObject()
Get the user object


setPool

public final UtlPlist.Element<T> setPool(UtlPool<UtlPlist.Element<T>> pool)
Description copied from interface: UtlPool.Item
Set a pool item's pool.

This method is invoked by an item pool at the time an item is added to the pool. The intent is to record the item's source pool in the item so it can be disposed back into the pool when the user is done working with it.

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

getPool

public final UtlPool<UtlPlist.Element<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<UtlPlist.Element<T>>
Returns:
the pool set using UtlPool.Item.setPool(com.neeve.util.UtlPool)

init

public final UtlPlist.Element<T> init()
Description copied from interface: UtlPool.Item
Initialize an item.

This method is invoked by an item pool very time an item is put into the pool. The method should wipe the contents of the item so as to present a fresh instance of the item to the caller when retrieved from the pool.

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


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