A simple set class that contains a number of distinct string elements.
|
Set | new (var copy) |
| The Set ructor (can be used as a copy ructor) More...
|
|
Set | clear () |
| Removes all elements from the set. More...
|
|
Set | add (var value) |
| Add an element to a set. More...
|
|
Set | remove (var value) |
| Remove an element from a set. If the element is not in the set, then this method does nothing. More...
|
|
| Set.union (var set1, var set2) |
| Creates a union of two existing sets. More...
|
|
Set | isMember (var value) |
| Tests for existence of an element in a set. More...
|
|
Set | getValues () |
| Returns a reference to the element array used by the set (unsafe) More...
|
|
Set | getSize () |
| Returns the number of elements in the set. More...
|
|
Set | toString () |
| Converts a set to a string representation. More...
|
|
| Set.fromString (var str) |
| Converts a string back to a set (the complement of toString()) More...
|
|
Add an element to a set.
- Parameters
-
value | the element to add (must be a string) |
Removes all elements from the set.
Removes all relations.
Returns the number of elements in the set.
- Returns
- the number of elements in the set
Returns a reference to the element array used by the set (unsafe)
- Returns
- a reference to the element array used by the set (unsafe)
Set isMember |
( |
var |
value | ) |
|
Tests for existence of an element in a set.
- Parameters
-
- Returns
- true if the value is in the set, or false otherwise
The Set ructor (can be used as a copy ructor)
- Parameters
-
copy | an exisiting set to make a copy of |
- Returns
- a new instance of Set
Remove an element from a set. If the element is not in the set, then this method does nothing.
- Parameters
-
value | the element to remove (must be a string) |
Set.fromString |
( |
var |
str | ) |
|
Converts a string back to a set (the complement of toString())
- Returns
- a new instance of set corresponding to the supplied string
- Note
- Only works for strings containing only alphabetic characters. like EUR, GBP etc.
Set.union |
( |
var |
set1, |
|
|
var |
set2 |
|
) |
| |
Creates a union of two existing sets.
- Parameters
-
set1 | the first set |
set2 | the second set |
- Returns
- a new set containing all elements from set1 and set2
Converts a set to a string representation.
- Returns
- a comma-separated list of the elements in the set