home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IAKEYSET.C < prev    next >
Text File  |  1993-09-22  |  2KB  |  51 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.  
  13. template < class Element, class Key >
  14. INumber IAKeySet < Element, Key >::
  15. numberOfElementsWithKey (Key const& key) const
  16. { if (containsElementWithKey (key))
  17.     return 1;
  18.   else
  19.     return 0;
  20. }
  21.  
  22. template < class Element, class Key >
  23. IBoolean IAKeySet < Element, Key >::
  24. locateNextElementWithKey (Key const&, ICursor& cursor) const
  25. { elementAt (cursor); // just for precondition checking
  26.   cursor.invalidate ();
  27.   return False;
  28. }
  29.  
  30. template < class Element, class Key >
  31. INumber IAKeySet < Element, Key >::
  32. removeAllElementsWithKey (Key const& key)
  33. { if (removeElementWithKey (key))
  34.     return 1;
  35.   else
  36.     return 0;
  37. }
  38.  
  39. template < class Element, class Key >
  40. INumber IAKeySet < Element, Key >::
  41. numberOfDifferentKeys () const
  42. { return numberOfElements ();
  43. }
  44.  
  45. template < class Element, class Key >
  46. IBoolean IAKeySet < Element, Key >::
  47. setToNextWithDifferentKey (ICursor& cursor) const
  48. { return setToNext (cursor);
  49. }
  50.  
  51.