libgdx API

com.badlogic.gdx.utils
Class SortedIntList<E>

java.lang.Object
  extended by com.badlogic.gdx.utils.SortedIntList<E>
Type Parameters:
E -
All Implemented Interfaces:
java.lang.Iterable<SortedIntList.Node<E>>

public class SortedIntList<E>
extends java.lang.Object
implements java.lang.Iterable<SortedIntList.Node<E>>

A sorted double linked list which uses ints for indexing


Nested Class Summary
static class SortedIntList.Node<E>
           
 
Constructor Summary
SortedIntList()
          Creates an ascending list
 
Method Summary
 void clear()
          Clears list
 E get(int index)
          Retrieves an element at a given index
 E insert(int index, E value)
          Inserts an element into the list at the given index
 java.util.Iterator<SortedIntList.Node<E>> iterator()
          Returns an iterator to traverse the list.
Only one iterator can be active per list at any given time.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedIntList

public SortedIntList()
Creates an ascending list

Method Detail

insert

public E insert(int index,
                E value)
Inserts an element into the list at the given index

Parameters:
index - Index of the element
value - Element to insert
Returns:
Element replaced by newly inserted element, null if nothing was replaced

get

public E get(int index)
Retrieves an element at a given index

Parameters:
index - Index of the element to retrieve
Returns:
Matching element, null otherwise

clear

public void clear()
Clears list


size

public int size()
Returns:
size of list equal to elements contained in it

iterator

public java.util.Iterator<SortedIntList.Node<E>> iterator()
Returns an iterator to traverse the list.
Only one iterator can be active per list at any given time.

Specified by:
iterator in interface java.lang.Iterable<SortedIntList.Node<E>>
Returns:
Iterator to traverse list

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)