linkedLists
Class DIntList

java.lang.Object
  extended by linkedLists.DIntList

public class DIntList
extends java.lang.Object


Constructor Summary
DIntList()
          Default constructor that creates an empty list
DIntList(DIntNode n)
          constructor to create a list with head node n
 
Method Summary
 void addFirst(DIntNode n)
          add a new node at front of list
 void addValue(int i)
          add node to front of list containing a given value
 DIntNode delete(int v)
          delete all nodes containing the value v from list and return the head of the list
 DIntNode delete0()
          delete the first node containing 0 from list and return the head of the list
 DIntNode getHead()
          return the head of the list
 boolean isEmpty()
          is the list empty?
 void setHead(DIntNode n)
          set the head of the list
 int size()
          return size of list
 int sum()
          returns the sum of the elements list, recursive
 java.lang.String toString()
          String representation of list, recursive
 void writePos()
          output positive elements of list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DIntList

public DIntList()
Default constructor that creates an empty list


DIntList

public DIntList(DIntNode n)
constructor to create a list with head node n

Method Detail

getHead

public DIntNode getHead()
return the head of the list


setHead

public void setHead(DIntNode n)
set the head of the list


isEmpty

public boolean isEmpty()
is the list empty?


addFirst

public void addFirst(DIntNode n)
add a new node at front of list


addValue

public void addValue(int i)
add node to front of list containing a given value


writePos

public void writePos()
output positive elements of list


delete0

public DIntNode delete0()
delete the first node containing 0 from list and return the head of the list


delete

public DIntNode delete(int v)
delete all nodes containing the value v from list and return the head of the list


size

public int size()
return size of list


sum

public int sum()
returns the sum of the elements list, recursive


toString

public java.lang.String toString()
String representation of list, recursive

Overrides:
toString in class java.lang.Object