//---------------------------------------------------------------------- // SPECIFICATION FILE (cset.h) // This module exports a character set ADT. A more general module // would include additional set operations. //---------------------------------------------------------------------- #ifndef cset_h #define cset_h #include "bool.h" class CharSet { // ABSTRACTLY: a collection of ASCII characters public: Boolean IsEmpty() const; // POST: FCTVAL == (collection is empty) Boolean IsFull() const; // POST: FCTVAL == true if no more // items can be stored, false otherwise void Insert( char ch ); // PRE: the collection isn't full // MODIFIES: self // POST: self == self union {i} void Delete( char ch ); // MODIFIES: self // POST: self == self - i Boolean IsElt( char ch ) const; // POST: FCTVAL == (i is in collection) CharSet Intersect( CharSet set2 ) const; // POST: FCTVAL == is a collection of // the elements in both self and set2 CharSet Union( CharSet set2 ) const; // POST: FCTVAL == is a collection of // the elements in either self or set2 CharSet(); // MODIFIES: self // POST: the collection is empty #include "cset.pri" }; #endif