linkedLists
Class SLinkedList1

java.lang.Object
  extended by linkedLists.SLinkedList1

public class SLinkedList1
extends java.lang.Object

Singly linked list with just a head storing strings


Constructor Summary
SLinkedList1()
          Default constructor that creates an empty list
 
Method Summary
 void addFirst(Node n)
          add a new node at front of list
 void addValue(java.lang.String s)
          add node to front of list containing a given value
 void addValueInOrder(java.lang.String s)
          Add new value in non-decreasing order into list
 Node getHead()
          return the head of the list
 long getSize()
          return the size of the list
 boolean inList(java.lang.String s)
          is Node containing given String in list?
 boolean isEmpty()
          is the list empty?
 void removeFirst()
          remove node from front of list
 void removeValue(java.lang.String s)
          remove all nodes containing element with a given value
 void setHead(Node n)
          set the head of the list
 java.lang.String toString()
          String representation of list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SLinkedList1

public SLinkedList1()
Default constructor that creates an empty list

Method Detail

getSize

public long getSize()
return the size of the list


getHead

public Node getHead()
return the head of the list


setHead

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


isEmpty

public boolean isEmpty()
is the list empty?


addFirst

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


removeFirst

public void removeFirst()
remove node from front of list


addValue

public void addValue(java.lang.String s)
add node to front of list containing a given value


inList

public boolean inList(java.lang.String s)
is Node containing given String in list?


addValueInOrder

public void addValueInOrder(java.lang.String s)
Add new value in non-decreasing order into list


removeValue

public void removeValue(java.lang.String s)
remove all nodes containing element with a given value


toString

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

Overrides:
toString in class java.lang.Object