/**
 * list.h
 * Jim Glenn 10/25/2002
 *
 * Sorted list implementation modified to add a copy function and a
 * copy constructor.  Additions since last modification (changing to
 * dynamically allocated array) are noted with // comments
 */

#ifndef __LIST_H__
#define __LIST_H__

#include "property.h"

typedef Property ItemType;

class List
{
public:
  List();
  List(const List& toCopy); // copy constructor
  ~List();

  bool isFull() const;
  int getLength() const;
  void retrieveItem(ItemType& i, bool& found) const;
  
  void makeEmpty();
  void addItem(const ItemType&);
  void deleteItem(const ItemType&);
  void copyFrom(const List& toCopy); // replacement for =
  
  void resetCurrent();
  void getNextItem(ItemType&);

private:
  void binarySearch(const ItemType&, int& loc, bool& found) const;

  int maxItems;
  int currentIndex;
  int numItems;
  ItemType* items;
};

#endif

