//----------------------------------------------------------------------
//  SPECIFICATION FILE (intlist.h)
//  This module exports IntList, an ADT for maintaining lists of
//  integers.
//  GenList is a private base class of IntList.
//----------------------------------------------------------------------
#include "bool.h"
#include "genlist.h"

// DOMAIN: Each list is a collection of integer values, along with an
//         implicit list cursor in the range 1..n+1, where n is
//         the current length of the list

class IntList : GenList {
public:
    GenList::IsEmpty;
        // POST: FCTVAL == (list is empty)

    GenList::IsFull;
        // POST: FCTVAL == (list is full)

    GenList::Reset;
        // PRE:  NOT IsEmpty()
        // POST: List cursor is at front of list

    GenList::EndOfList;
        // POST: FCTVAL == (list cursor is beyond end of list)

    GenList::Advance;
        // PRE:  NOT IsEmpty()  &&  NOT EndOfList()
        // POST: List cursor has advanced to next item

    int CurrentItem() const;
        // PRE:  NOT IsEmpty()  &&  NOT EndOfList()
        // POST: FCTVAL == item at list cursor

    void InsertBefore( /* in */ int someInt );
        // PRE:  Assigned(someInt)  &&  NOT IsFull()
        // POST: someInt inserted before list cursor
        //          (at back, if EndOfList())
        //    && This is the new current item

    void InsertAfter( /* in */ int someInt );
        // PRE:  Assigned(someInt)  &&  NOT IsEmpty()
        //   &&  NOT IsFull()  &&  NOT EndOfList()
        // POST: someInt inserted after list cursor
        //    && This is the new current item

    void Delete();
        // PRE:  NOT IsEmpty()  &&  NOT EndOfList()
        // POST: Item at list cursor deleted
        //    && Successor of deleted item is now the current item

    IntList();
        // POST: Created(list)  &&  IsEmpty()  &&  EndOfList()

    IntList( const IntList& otherList );
        // POST: Created(list)  &&  list == otherList  &&  EndOfList()

    ~IntList();
        // POST: List destroyed
private:
    // No additional private members
};

