home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IAKEY.H < prev    next >
Text File  |  1993-09-22  |  3KB  |  74 lines

  1. /*******************************************************************************
  2. *                                                                              *
  3. * COPYRIGHT:                                                                   *
  4. *   IBM C/C++ Tools Version 2.01 - Collection Class Library                    *
  5. *   Licensed Materials - Property of IBM                                       *
  6. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  7. *   All Rights Reserved                                                        *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  10. *                                                                              *
  11. *******************************************************************************/
  12. #ifndef _IAKEY_H
  13. #define _IAKEY_H
  14.  
  15. #include <iglobals.h>
  16. #include <icursor.h>
  17. #include <iacllct.h>
  18.  
  19. template < class Element, class Key >
  20. class IAKeyCollection : public virtual IACollection < Element > {
  21. public:
  22.  
  23.   virtual Key const&     key                         (Element const&) const = 0;
  24.  
  25.   virtual IBoolean       containsElementWithKey      (Key const&) const = 0;
  26.  
  27.   virtual IBoolean       containsAllKeysFrom         (IACollection <Element>
  28.                                                const&) const;
  29.  
  30.   virtual IBoolean       locateElementWithKey        (Key const&, ICursor&)
  31.                                                const = 0;
  32.  
  33.   virtual IBoolean       replaceElementWithKey       (Element const&) = 0;
  34.  
  35.   virtual IBoolean       replaceElementWithKey       (Element const&,
  36.                                                ICursor&) = 0;
  37.  
  38.   virtual IBoolean       locateOrAddElementWithKey   (Element const&) = 0;
  39.  
  40.   virtual IBoolean       locateOrAddElementWithKey   (Element const&,
  41.                                                ICursor&) = 0;
  42.  
  43.   virtual IBoolean       addOrReplaceElementWithKey  (Element const&) = 0;
  44.  
  45.   virtual IBoolean       addOrReplaceElementWithKey  (Element const&,
  46.                                                ICursor&) = 0;
  47.  
  48.   virtual IBoolean       removeElementWithKey        (Key const&) = 0;
  49.  
  50.   virtual Element const& elementWithKey              (Key const&) const = 0;
  51.  
  52.   virtual Element&       elementWithKey              (Key const&) = 0;
  53.  
  54.   virtual INumber        numberOfElementsWithKey     (Key const&) const = 0;
  55.  
  56.   virtual IBoolean       locateNextElementWithKey    (Key const&,
  57.                                                ICursor&) const = 0;
  58.  
  59.   virtual INumber        removeAllElementsWithKey    (Key const&) = 0;
  60.  
  61.   virtual INumber        numberOfDifferentKeys       () const = 0;
  62.  
  63.   virtual IBoolean       setToNextWithDifferentKey   (ICursor&) const = 0;
  64.  
  65. };
  66.  
  67. #ifdef __IBMCPP__
  68. #ifndef __TEMPINC__
  69. #include <iakey.c>
  70. #endif
  71. #endif
  72.  
  73. #endif
  74.