home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IASET.C
< prev
next >
Wrap
Text File
|
1993-09-22
|
2KB
|
55 lines
/*******************************************************************************
* *
* COPYRIGHT: *
* IBM C/C++ Tools Version 2.01 - Collection Class Library *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
template < class Element >
INumber IASet < Element >::
numberOfOccurrences (Element const& element) const
{ if (contains (element))
return 1;
else
return 0;
}
template < class Element >
IBoolean IASet < Element >::
locateNext (Element const&, ICursor& cursor) const
{ elementAt (cursor); // just for precondition checking
cursor.invalidate ();
return False;
}
template < class Element >
INumber IASet < Element >::
removeAllOccurrences (Element const& element)
{ if (remove (element))
return 1;
else
return 0;
}
template < class Element >
IBoolean IASet < Element >::
operator == (IASet < Element > const& collection) const
{ if (numberOfElements () != collection.numberOfElements ())
return False;
return containsAllFrom (collection);
}
template < class Element >
IBoolean IASet < Element >::
operator != (IASet < Element > const& collection) const
{ return ! operator == (collection);
}