Package com.badlogic.gdx.utils
Class PooledLinkedList<T>
- java.lang.Object
-
- com.badlogic.gdx.utils.PooledLinkedList<T>
-
public class PooledLinkedList<T> extends java.lang.ObjectA simple linked list that pools its nodes.
-
-
Constructor Summary
Constructors Constructor Description PooledLinkedList(int maxPoolSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T object)Adds the specified object to the end of the list regardless of iteration statusvoidaddFirst(T object)Adds the specified object to the head of the list regardless of iteration statusvoidclear()voiditer()Starts iterating over the list's items from the head of the listvoiditerReverse()Starts iterating over the list's items from the tail of the listTnext()Gets the next item in the listTprevious()Gets the previous item in the listvoidremove()Removes the current list item based on the iterator position.TremoveLast()Removes the tail of the list regardless of iteration statusintsize()Returns the number of items in the list
-
-
-
Method Detail
-
add
public void add(T object)
Adds the specified object to the end of the list regardless of iteration status
-
addFirst
public void addFirst(T object)
Adds the specified object to the head of the list regardless of iteration status
-
size
public int size()
Returns the number of items in the list
-
iter
public void iter()
Starts iterating over the list's items from the head of the list
-
iterReverse
public void iterReverse()
Starts iterating over the list's items from the tail of the list
-
next
@Null public T next()
Gets the next item in the list- Returns:
- the next item in the list or null if there are no more items
-
previous
@Null public T previous()
Gets the previous item in the list- Returns:
- the previous item in the list or null if there are no more items
-
remove
public void remove()
Removes the current list item based on the iterator position.
-
clear
public void clear()
-
-