home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD 24 / PCPLUS115.iso / pcplus / tclite / include / bag.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-28  |  1.1 KB  |  37 lines

  1. #ifndef    BAG_H
  2. #define    BAG_H
  3.  
  4. #include "collect.h"
  5. #include "dict.h"
  6.  
  7. extern const Class class_Bag;
  8.  
  9. class Bag: public Collection {
  10.     unsigned count;
  11.     Dictionary contents;
  12. public:
  13.     Bag(unsigned size =CLTN_DEFAULT_CAPACITY);
  14.     Bag(const Bag&);
  15.     Object* addWithOccurrences(const Object&, unsigned);
  16.     bool operator!=(const Bag& a) const           { return !(*this==a); }
  17.     void operator=(const Bag&);
  18.     bool operator==(const Bag&) const;
  19.     virtual Object* add(const Object&);
  20.     virtual Collection& addContentsTo(Collection&) const;
  21.     virtual Object*& at(int) const;
  22.     virtual unsigned capacity() const;
  23.     virtual void    deepenShallowCopy();
  24.     virtual Object* doNext(Iterator&) const;
  25.     virtual unsigned hash() const;
  26.     virtual const Class*    isA() const;
  27.     virtual bool    isEqual(const Object&) const;
  28.     virtual unsigned occurrencesOf(const Object&) const;
  29.     virtual void    printOn(ostream& strm) const;
  30.     virtual void    reSize(unsigned) const;
  31.     virtual Object* remove(const Object&);
  32.     virtual unsigned size() const;
  33.     virtual const Class*    species() const;
  34. };
  35.  
  36. #endif
  37.