////////////////////////////////////////////////////////////////////////////
//Tom Valesky
//CS-752
//Dr. Chen, instructor
//LIST.H - Base class for objects of type list (recycled from another assignment)
////////////////////////////////////////////////////////////////////////////

#ifndef LIST_H
#define LIST_H

#include "node.h"

class List
{
   friend class Node;
   int number_of_elements;
   Node *head, *tail, *current;
   public:
      List();
      ~List();
      int set_head(void);
      int set_tail(void);
      int set_next(void);
      int set_prev(void);
      int at_head(void);
      int at_tail(void);
      int is_empty(void);
      int size(void);
      void display_node(void); //looks inside node and displays
                               //its data
      void display_list(void);
      void delete_node(void);  //deletes the current node and sets
                               //'current' to following node;
                               //if at end of list, sets current to prev.
      Node *detach_node_from_list(void);
                               //used to remove nodes from text list 
                               //without physically deleting them

                               //inserts new node after 'current'
                               //sets 'current' to new_node
      void insert_node(Node *new_node);
      void insert_node_at_head(Node *new_node);
      void delete_list(void);
      Node *add(Node *n);
      Node *del(void);
      void print(char *comment);
      void *get_current_data(void) {return current->data;};

};
#endif

