danger.util
Class LinkedList

java.lang.Object
  |
  +--danger.util.LinkedList

public class LinkedList
extends java.lang.Object


Constructor Summary
LinkedList()
          Constructs an empty Linked List.
 
Method Summary
 void add(java.lang.Object o)
           
 void addAll(LinkedList list)
           
 void addFirst(java.lang.Object o)
          Inserts the given element at the beginning of this List.
 void addLast(java.lang.Object o)
          Appends the given element to the end of this List.
 void clear()
          Removes all of the elements from this List.
 java.lang.Object get(int index)
           
 java.lang.Object getFirst()
          Returns the first Element in this List.
 java.lang.Object getLast()
          Returns the last Element in this List.
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 ListIterator listIterator(ListIterator oldlist)
           
 java.lang.Object remove(int index)
           
 java.lang.Object remove(java.lang.Object object)
           
 java.lang.Object removeFirst()
          Removes and returns the first Element from this List.
 java.lang.Object removeLast()
          Removes and returns the last Element from this List.
 int size()
          Returns the number of elements in this List.
 void swap(int index1, int index2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkedList

public LinkedList()
Constructs an empty Linked List.
Method Detail

getFirst

public java.lang.Object getFirst()
Returns the first Element in this List.

getLast

public java.lang.Object getLast()
Returns the last Element in this List.
Throws:
NoSuchElementException - List is empty.

get

public java.lang.Object get(int index)

removeFirst

public java.lang.Object removeFirst()
Removes and returns the first Element from this List.
Returns:
the first Element from this List.
Throws:
NoSuchElementException - List is empty.

removeLast

public java.lang.Object removeLast()
Removes and returns the last Element from this List.
Returns:
the last Element from this List.
Throws:
NoSuchElementException - List is empty.

remove

public java.lang.Object remove(int index)

remove

public java.lang.Object remove(java.lang.Object object)

addFirst

public void addFirst(java.lang.Object o)
Inserts the given element at the beginning of this List.

addLast

public void addLast(java.lang.Object o)
Appends the given element to the end of this List. (Identical in function to add(); included only for consistency.)

add

public void add(java.lang.Object o)

addAll

public void addAll(LinkedList list)

size

public int size()
Returns the number of elements in this List.

swap

public void swap(int index1,
                 int index2)

clear

public void clear()
Removes all of the elements from this List.

listIterator

public ListIterator listIterator(int index)

listIterator

public ListIterator listIterator(ListIterator oldlist)

listIterator

public ListIterator listIterator()


Danger Confidential. Copyright © 2000-2003, Danger Inc.