Class StringSet

An object that holds a set of strings, with basic set operations.
Defined in: utilities.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
StringSet(initialString1, initialString2, etc)
Constructor for an object that holds a set of strings, with basic set operations.
Method Summary
Method Attributes Method Name and Description
 
add(x)
Adds the given string to the set if it is not already in it.
 
Returns whether this set contains the given string.
 
Iterators over the strings in the set, calling the provided function on each element.
 
remove(x)
Removes the given string from the set if it is contained in it.
Class Detail
StringSet(initialString1, initialString2, etc)
Constructor for an object that holds a set of strings, with basic set operations. This is better for keeping track of a set than using an associative arrays, because it avoids key collisions with javascript built-ins like 'toString', 'class', etc.
Parameters:
{string} initialString1
{string} initialString2
{string} etc
...
Method Detail
add(x)
Adds the given string to the set if it is not already in it.
Parameters:
{string} x

{boolean} contains(x)
Returns whether this set contains the given string.
Parameters:
{string} x
Returns:
{boolean} Whether x exits in this set.

forEach(f)
Iterators over the strings in the set, calling the provided function on each element.
Parameters:
{function} f
The function to call on each string in the set.

remove(x)
Removes the given string from the set if it is contained in it.
Parameters:
{string} x
The string to remove from the set.

©2011 by JGate on AppJet
Documentation generated by JsDoc Toolkit 2.1.0 on Thu Jan 06 2011 10:36:33 GMT+0100 (MEZ)