home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP10-8.ZIP / CLASSINC.ZIP / DICT.H < prev    next >
C/C++ Source or Header  |  1990-09-26  |  4KB  |  160 lines

  1. #ifndef __DICT_H
  2. #define __DICT_H
  3.  
  4. //
  5. // This file contains proprietary information of Borland International.
  6. // Copying or reproduction without prior written approval is prohibited.
  7. //
  8. // Copyright (c) 1990
  9. // Borland International
  10. // 1800 Scotts Valley Dr.
  11. // Scotts Valley, CA 95066
  12. // (408) 438-8400
  13. //
  14.  
  15. // Contents ----------------------------------------------------------------
  16. //
  17. //         Dictionary
  18. //
  19. // Description
  20. //
  21. //         Defines the class Dictionary.  Dictionary holds a set of objects
  22. //         of type Association, which each contain a key and a value.
  23. //         Dictionary uses the key to look up the associated value.
  24. //
  25. // End ---------------------------------------------------------------------
  26.  
  27. // Interface Dependencies ---------------------------------------------------
  28.  
  29. #ifndef __STDLIB_H
  30. #include <stdlib.h>
  31. #define __STDLIB_H
  32. #endif
  33.  
  34. #ifndef __IOSTREAM_H
  35. #include <iostream.h>
  36. #define __IOSTREAM_H
  37. #endif
  38.  
  39. #ifndef __CLSTYPES_H
  40. #include <clstypes.h>
  41. #endif
  42.  
  43. #ifndef __CLSDEFS_H
  44. #include <clsdefs.h>
  45. #endif
  46.  
  47. #ifndef __OBJECT_H
  48. #include <object.h>
  49. #endif
  50.  
  51. #ifndef __ASSOC_H
  52. #include <assoc.h>
  53. #endif
  54.  
  55. #ifndef __SET_H
  56. #include <set.h>
  57. #endif
  58.  
  59. // End Interface Dependencies ------------------------------------------------
  60.  
  61.  
  62. // Class //
  63.  
  64. class Dictionary : public Set
  65. {
  66. public:
  67.             Dictionary() {}
  68.             Dictionary( Dictionary& );
  69.     virtual ~Dictionary();
  70.  
  71.     virtual void            add( Object& );
  72.             Association&    lookup( const Object& ) const;
  73.  
  74.     virtual classType       isA() const;
  75.     virtual char           *nameOf() const;
  76. };
  77.  
  78. // Description -------------------------------------------------------------
  79. //
  80. //         Defines the class Dictionary.  Dictionary holds a set of objects
  81. //         of type Association, which each contain a key and a value.
  82. //         Dictionary uses the key to look up the associated value.
  83. //
  84. // Constructor
  85. //
  86. //         Dictionary
  87. //
  88. //         Default constructor.
  89. //
  90. // Destructor
  91. //
  92. //         ~Dictionary
  93. //
  94. // Public Members
  95. //
  96. //      add
  97. //
  98. //      Adds an object to the collection.
  99. //
  100. //         lookup
  101. //
  102. //         Converts an object to an association with no value, then finds
  103. //         that association in the dictionary.
  104. //
  105. //         isA
  106. //
  107. //         Returns the class type of dictionary.
  108. //
  109. //         nameOf
  110. //
  111. //         Returns a character pointer to the string "Dictionary."
  112. //
  113. //         hashValue
  114. //
  115. //         Inherited from Object.
  116. //
  117. // Inherited Members
  118. //
  119. //      destroy
  120. //
  121. //      Removes an object reference from the collection and
  122. //      destroys the object.
  123. //
  124. //         detach
  125. //
  126. //         Removes all references to the object in the collection.
  127. //      Does not delete the object.  Use this function when the collection
  128. //      elements are not owned by the collection.
  129. //
  130. //         lookup
  131. //
  132. //         Inherited from HashTable.
  133. //
  134. //      hasMember
  135. //
  136. //         Test whether an object is part of the collection.  Returns 1 if
  137. //      the object reference is found in the array.
  138. //
  139. //         initIterator
  140. //
  141. //         Inherited from HashTable.
  142. //
  143. //         isEmpty
  144. //
  145. //         Returns a 1 if the collection has no members.  Returns a 0
  146. //         otherwise.
  147. //
  148. //      firstThat
  149. //
  150. //      Returns the first object that satisfies the given condition.
  151. //
  152. //      lastThat
  153. //
  154. //      Returns the last object that satisfies the given condition.
  155. //
  156. // End ---------------------------------------------------------------------
  157.  
  158.  
  159. #endif // ifndef __DICT_H //
  160.