ASL
|
A set is a container of unique elements in any order.
The type of items must have a corresponding global hash() function.
You can perform operations between sets:
#include <Set.h>
Inherits MAP< T, int >.
Public Member Functions | |
Array< T > | array () const |
Returns the set items as an array. | |
Set & | operator<< (const T &x) |
Adds an item to the set. | |
Set & | operator<< (const Set &s) |
Adds all items in set s into this set. | |
bool | operator== (const Set &s) const |
Returns true if both sets have the same items. | |
bool | operator!= (const Set &s) const |
Returns true if both sets don't have the same items. | |
bool | contains (const T &x) const |
Checks if this set contains a given item. | |
bool | contains (const Set &s) const |
Checks if this set contains all items from another set. | |
bool | containsAny (const Set &s) const |
Checks if this set contains at least one item from another set. | |
Set | notIn (const Set &s) const |
Returns the items from this set which do not belong to another set. | |
Set | in (const Set &s) const |
Returns the items from this set which also belong to another set. | |
Set | operator& (const Set &s) const |
Returns the items from this set which also belong to another set (intersection) | |
Set | operator- (const Set &s) const |
Returns the items from this set which do not belong to another set (subtraction) | |
Set | operator+ (const Set &s) const |
Returns all items from this and another set (union) | |