org.jikesrvm.util
Class LinkedListRVM<T>

java.lang.Object
  extended by org.jikesrvm.util.LinkedListRVM<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>

public final class LinkedListRVM<T>
extends Object
implements List<T>

Implementation of java.util.LinkedList for use in classes that end up in the boot image.


Nested Class Summary
(package private) static class LinkedListRVM.Element<T>
          Class for the actual elements of the list.
 
Field Summary
private  int count
          Element count
(package private)  LinkedListRVM.Element<T> head
          pointer to first element in the list
(package private)  LinkedListRVM.Element<T> tail
          pointer to last element in the list
 
Constructor Summary
LinkedListRVM()
           
 
Method Summary
 void add(int pos, T entry)
          Insert an element at a given position in the list.
 boolean add(T entry)
          Insert at the tail of the list
 boolean addAll(Collection<? extends T> arg0)
          Add all members of the given collection.
 boolean addAll(int arg0, Collection<? extends T> arg1)
          Add all members of the given collection after the given element.
 void clear()
          Discard all entries in the list
 boolean contains(Object arg0)
          Membership test
 boolean containsAll(Collection<?> arg0)
          Set inclusion test
 T get(int index)
          Return the nth element of the list UNIMPLEMENTED
 int indexOf(Object arg0)
          Return the position of the given element.
(package private)  void insertAfter(LinkedListRVM.Element<T> e, T t)
          Insert an entry after the given element.
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 int lastIndexOf(Object arg0)
          UNIMPLEMENTED
 ListIterator<T> listIterator()
           
 ListIterator<T> listIterator(int arg0)
          UNIMPLEMENTED
 T remove(int index)
          Remove the nth element of the list.
 boolean remove(Object arg0)
          Remove the given element from the list
 boolean removeAll(Collection<?> arg0)
          UNIMPLEMENTED
(package private)  void removeInternal(LinkedListRVM.Element<T> e)
           
 boolean retainAll(Collection<?> arg0)
          UNIMPLEMENTED
 T set(int arg0, T arg1)
          UNIMPLEMENTED
 int size()
           
 List<T> subList(int arg0, int arg1)
          UNIMPLEMENTED
 Object[] toArray()
          UNIMPLEMENTED
<U> U[]
toArray(U[] arg0)
          UNIMPLEMENTED
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Field Detail

count

private int count
Element count


head

LinkedListRVM.Element<T> head
pointer to first element in the list


tail

LinkedListRVM.Element<T> tail
pointer to last element in the list

Constructor Detail

LinkedListRVM

public LinkedListRVM()
Method Detail

add

public void add(int pos,
                T entry)
Insert an element at a given position in the list.

UNIMPLEMENTED

Specified by:
add in interface List<T>
Parameters:
pos - Position in the list (0..size()-1)
entry - Element to insert

add

public boolean add(T entry)
Insert at the tail of the list

Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Parameters:
entry - The entry to add.
Returns:
true (as per java collections framework standard)

insertAfter

void insertAfter(LinkedListRVM.Element<T> e,
                 T t)
Insert an entry after the given element. Used via the iterator.

Parameters:
e - List element
t - New list entry

addAll

public boolean addAll(Collection<? extends T> arg0)
Add all members of the given collection.

UNIMPLEMENTED

Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>

addAll

public boolean addAll(int arg0,
                      Collection<? extends T> arg1)
Add all members of the given collection after the given element.

UNIMPLEMENTED

Specified by:
addAll in interface List<T>

clear

public void clear()
Discard all entries in the list

Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>

contains

public boolean contains(Object arg0)
Membership test

Specified by:
contains in interface Collection<T>
Specified by:
contains in interface List<T>
Parameters:
arg0 - Object to check
Returns:
true if the list contains arg0, false otherwise

containsAll

public boolean containsAll(Collection<?> arg0)
Set inclusion test

Specified by:
containsAll in interface Collection<T>
Specified by:
containsAll in interface List<T>
Parameters:
arg0 - Objects to check
Returns:
true if the list contains all objects in arg0, false otherwise

get

public T get(int index)
Return the nth element of the list

UNIMPLEMENTED

Specified by:
get in interface List<T>
Parameters:
index -

indexOf

public int indexOf(Object arg0)
Return the position of the given element.

Specified by:
indexOf in interface List<T>
Parameters:
arg0 - Member to test for.
Returns:
Zero-based index of the element, or -1 if not found.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T>
Specified by:
isEmpty in interface List<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>
Specified by:
iterator in interface List<T>

lastIndexOf

public int lastIndexOf(Object arg0)
UNIMPLEMENTED

Specified by:
lastIndexOf in interface List<T>

listIterator

public ListIterator<T> listIterator()
Specified by:
listIterator in interface List<T>

listIterator

public ListIterator<T> listIterator(int arg0)
UNIMPLEMENTED

Specified by:
listIterator in interface List<T>

remove

public T remove(int index)
Remove the nth element of the list.

Specified by:
remove in interface List<T>
Parameters:
index - n
Returns:
The nth element

remove

public boolean remove(Object arg0)
Remove the given element from the list

Specified by:
remove in interface Collection<T>
Specified by:
remove in interface List<T>

removeInternal

void removeInternal(LinkedListRVM.Element<T> e)

removeAll

public boolean removeAll(Collection<?> arg0)
UNIMPLEMENTED

Specified by:
removeAll in interface Collection<T>
Specified by:
removeAll in interface List<T>

retainAll

public boolean retainAll(Collection<?> arg0)
UNIMPLEMENTED

Specified by:
retainAll in interface Collection<T>
Specified by:
retainAll in interface List<T>

set

public T set(int arg0,
             T arg1)
UNIMPLEMENTED

Specified by:
set in interface List<T>

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>

subList

public List<T> subList(int arg0,
                       int arg1)
UNIMPLEMENTED

Specified by:
subList in interface List<T>

toArray

public Object[] toArray()
UNIMPLEMENTED

Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>

toArray

public <U> U[] toArray(U[] arg0)
UNIMPLEMENTED

Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>