eu.beesoft.gaia.util
Class FastList<E>

java.lang.Object
  extended by eu.beesoft.gaia.util.FastList<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>

public class FastList<E>
extends java.lang.Object
implements java.util.List<E>


Constructor Summary
FastList()
           
FastList(java.util.List<E> initialData)
           
 
Method Summary
 boolean add(E o)
          Appends the specified element to the end of this List (optional operation).
 void add(int index, E element)
          Inserts the specified element at the specified position in this list (optional operation).
 boolean addAll(java.util.Collection<? extends E> c)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
 boolean addAll(int index, java.util.Collection<? extends E> c)
          Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
 void clear()
          Removes all of the elements from this collection (optional operation).
 boolean contains(java.lang.Object o)
          Returns true if this list contains the specified element.
 boolean containsAll(java.util.Collection<?> c)
          Returns true if this list contains all of the elements of the specified collection.
protected  java.util.List<E> createList()
           
 boolean equals(java.lang.Object o)
          Compares the specified object with this list for equality.
 E get(int index)
          Returns the element at the specified position in this list.
 int hashCode()
          Returns the hash code value for this list.
 int indexOf(java.lang.Object o)
          Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.
 boolean isEmpty()
           
 java.util.Iterator<E> iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int lastIndexOf(java.lang.Object o)
          Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
 java.util.ListIterator<E> listIterator()
          Returns an iterator of the elements in this list (in proper sequence).
 java.util.ListIterator<E> listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
 E remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(java.lang.Object o)
          Removes the first occurrence in this list of the specified element (optional operation).
 boolean removeAll(java.util.Collection<?> c)
          Removes from this list all the elements that are contained in the specified collection (optional operation).
 boolean retainAll(java.util.Collection<?> c)
          Retains only the elements in this list that are contained in the specified collection (optional operation).
 E set(int index, E element)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 int size()
           
 java.util.List<E> subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
          Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastList

public FastList()

FastList

public FastList(java.util.List<E> initialData)
Method Detail

add

public boolean add(E o)
Appends the specified element to the end of this List (optional operation).

Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.List<E>

add

public void add(int index,
                E element)
Inserts the specified element at the specified position in this list (optional operation).

Specified by:
add in interface java.util.List<E>

addAll

public boolean addAll(java.util.Collection<? extends E> c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

Specified by:
addAll in interface java.util.Collection<E>
Specified by:
addAll in interface java.util.List<E>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends E> c)
Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

Specified by:
addAll in interface java.util.List<E>

clear

public void clear()
Removes all of the elements from this collection (optional operation).

Specified by:
clear in interface java.util.Collection<E>
Specified by:
clear in interface java.util.List<E>

contains

public boolean contains(java.lang.Object o)
Returns true if this list contains the specified element.

Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.List<E>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Returns true if this list contains all of the elements of the specified collection.

Specified by:
containsAll in interface java.util.Collection<E>
Specified by:
containsAll in interface java.util.List<E>

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this list for equality.

Specified by:
equals in interface java.util.Collection<E>
Specified by:
equals in interface java.util.List<E>
Overrides:
equals in class java.lang.Object

get

public E get(int index)
Returns the element at the specified position in this list.

Specified by:
get in interface java.util.List<E>

hashCode

public int hashCode()
Returns the hash code value for this list.

Specified by:
hashCode in interface java.util.Collection<E>
Specified by:
hashCode in interface java.util.List<E>
Overrides:
hashCode in class java.lang.Object

indexOf

public int indexOf(java.lang.Object o)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element.

Specified by:
indexOf in interface java.util.List<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<E>
Specified by:
isEmpty in interface java.util.List<E>

iterator

public java.util.Iterator<E> iterator()
Returns an iterator over the elements in this list in proper sequence.

Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>
Specified by:
iterator in interface java.util.List<E>

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.

Specified by:
lastIndexOf in interface java.util.List<E>

listIterator

public java.util.ListIterator<E> listIterator()
Returns an iterator of the elements in this list (in proper sequence).

Specified by:
listIterator in interface java.util.List<E>

listIterator

public java.util.ListIterator<E> listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.

Specified by:
listIterator in interface java.util.List<E>

remove

public E remove(int index)
Removes the element at the specified position in this list (optional operation).

Specified by:
remove in interface java.util.List<E>

remove

public boolean remove(java.lang.Object o)
Removes the first occurrence in this list of the specified element (optional operation).

Specified by:
remove in interface java.util.Collection<E>
Specified by:
remove in interface java.util.List<E>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Removes from this list all the elements that are contained in the specified collection (optional operation).

Specified by:
removeAll in interface java.util.Collection<E>
Specified by:
removeAll in interface java.util.List<E>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Retains only the elements in this list that are contained in the specified collection (optional operation).

Specified by:
retainAll in interface java.util.Collection<E>
Specified by:
retainAll in interface java.util.List<E>

set

public E set(int index,
             E element)
Replaces the element at the specified position in this list with the specified element (optional operation).

Specified by:
set in interface java.util.List<E>

size

public int size()
Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.List<E>

subList

public java.util.List<E> subList(int fromIndex,
                                 int toIndex)
Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.

Specified by:
subList in interface java.util.List<E>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>

toArray

public <T> T[] toArray(T[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.

Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>

createList

protected java.util.List<E> createList()