Package org.oscim.utils.pool
Class Inlist<T extends Inlist<T>>
java.lang.Object
org.oscim.utils.pool.Inlist<T>
- Direct Known Subclasses:
BoxTree.BoxItem,BufferObject,KeyMap,KeyMap.HashItem,LList,MapTile.TileData,RenderBucket,SymbolItem,TextItem,TextureAtlas,TextureAtlas.Rect,TextureAtlas.Slot,TextureItem,VertexData.Chunk
Utility class for making poolable objects.
Instead of using an additional list to hold pool items just extend this
class.
Also handy for objects that exist in only *one list* at a time, if you
are *REALLY* sure about it. Better do not use it! :)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Inlist<?>>
TappendItem(T list, T item) Append 'item' to 'list'.static <T extends Inlist>
TappendList(T list, T other) Append list 'other' to 'list'.static <T extends Inlist<?>>
Tget(T list, int i) Gets the 'item' with index 'i'.static <T extends Inlist<?>>
Tlast(T list) Get last item in from list.next()static <T extends Inlist<?>>
TprependRelative(T list, T item, T other) Prepend 'item' relative to 'other'.static <T extends Inlist<?>>
Tpush(T list, T item) Push 'item' onto 'list'.static <T extends Inlist<?>>
Tremove(T list, T item) Removes the 'item' from 'list'.static <T extends Inlist<?>>
intsize(T list) Get size of 'list'.
-
Field Details
-
next
-
-
Constructor Details
-
Inlist
public Inlist()
-
-
Method Details
-
next
-
push
Push 'item' onto 'list'.- Parameters:
list- the listitem- the item- Returns:
- the new head of 'list' (item)
-
size
Get size of 'list'.- Parameters:
list- the list- Returns:
- the number of items in 'list'
-
remove
Removes the 'item' from 'list'.- Parameters:
list- the listitem- the item- Returns:
- the new head of 'list'
-
get
Gets the 'item' with index 'i'.- Parameters:
list- the listi- the index- Returns:
- the item or null
-
appendItem
Append 'item' to 'list'. 'item' may not be in another list, i.e. item.next must be null- Parameters:
list- the listitem- the item- Returns:
- the new head of 'list'
-
appendList
Append list 'other' to 'list'.- Parameters:
list- the listother- the other- Returns:
- the head of 'list'
-
last
Get last item in from list.- Parameters:
list- the list- Returns:
- the last item
-
prependRelative
Prepend 'item' relative to 'other'.- Parameters:
list- the listitem- the itemother- the other list- Returns:
- the new head of list
-