Bag  0.9
BagInterface.h
Go to the documentation of this file.
1 // Created by Frank M. Carrano and Tim Henry.
2 // Copyright (c) 2013 __Pearson Education__. All rights reserved.
3 
6 #ifndef _BAG_INTERFACE
7 #define _BAG_INTERFACE
8 
9 #include <vector>
10 using namespace std;
11 
12 template<class ItemType>
14 {
15 public:
18  virtual int getCurrentSize() const = 0;
19 
22  virtual bool isEmpty() const = 0;
23 
29  virtual bool add(const ItemType& newEntry) = 0;
30 
37  virtual bool remove(const ItemType& anEntry) = 0;
38 
41  virtual void clear() = 0;
42 
46  virtual int getFrequencyOf(const ItemType& anEntry) const = 0;
47 
51  virtual bool contains(const ItemType& anEntry) const = 0;
52 
56  virtual vector<ItemType> toVector() const = 0;
57 }; // end BagInterface
58 #endif