Class InfoLinkedList

java.lang.Object
  extended by InfoLinkedList

public class InfoLinkedList
extends java.lang.Object

A LinkedList containing Info objects as data


Field Summary
private  Node head
           
private  int size
           
private  Node tail
           
 
Constructor Summary
InfoLinkedList()
           
 
Method Summary
 void add(Info data)
          Add a new Info object to the end of the list.
 Info get(int index)
          return the Info object at position index.
 void printAll()
          for debugging.
 int size()
          returns the size of this list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

head

private Node head

tail

private Node tail

size

private int size
Constructor Detail

InfoLinkedList

public InfoLinkedList()
Method Detail

add

public void add(Info data)
Add a new Info object to the end of the list. You are not required to maintain tail and size, but it makes the method implementations a bit easier.

Parameters:
data -

get

public Info get(int index)
return the Info object at position index. throws IndexOutOfBoundsException if index is not a valid position in the list.

Parameters:
index -
Returns:

size

public int size()
returns the size of this list

Returns:

printAll

public void printAll()
for debugging. prints all elements of the list.