# Legato.Util.HashSet

Implements a map-backed set of strings.

Summary

Legato.Util.HashSet | Implements a map-backed set of strings.
Functions |
initialize | Constructs the set.
size | Returns: {Integer} Number of the elements in the set.
isEmpty | Returns: {Boolean} True if set is empty, false otherwise.
contains | Checks if the set contains the value or not.
add | Adds the value to the set.
addAll | Adds all the elements of the given collection to this set.
remove | Removes the element from the set.
toArray | Returns: {Array(String)} Array of elements contained in this set.
clear | Clears the set.

### Functions

### initialize

> initialize : function()

Constructs the set.

### size

> size : function()

Returns: {Integer} Number of the elements in the set.

### isEmpty

> isEmpty : function()

Returns: {Boolean} True if set is empty, false otherwise.

### contains

> contains : function( | value | )

Checks if the set contains the value or not.

#### Parameters

value | {String} element to add to the set.

Returns: {Boolean} True if given value is belongs to this set, false otherwise.

### add

> add : function( | value | )

Adds the value to the set.

#### Parameters

value | {String} element to be added to the set.

Returns: {Boolean} True if an element was added to the set, false if it was already a member of the set.

### addAll

> addAll : function( | set | )

Adds all the elements of the given collection to this set.

#### Parameters

set | set of string to be added to this set.

Returns: {Boolean} True if new element were added to the set, false otherwise.

### remove

> remove : function( | value | )

Removes the element from the set.

#### Parameters

value | {String} value to be removed from the set.

Returns: {Boolean} True if the value was removed from the given set, false if not (i.e. the value was not an element of this set).

### toArray

> toArray : function()

Returns: {Array(String)} Array of elements contained in this set. The order is not deterministic.

### clear

> clear : function()

Clears the set.

> initialize : function()

Constructs the set.

> size : function()

Returns: {Integer} Number of the elements in the set.

> isEmpty : function()

Returns: {Boolean} True if set is empty, false otherwise.

> contains : function( | value | )

Checks if the set contains the value or not.

> add : function( | value | )

Adds the value to the set.

> addAll : function( | set | )

Adds all the elements of the given collection to this set.

> remove : function( | value | )

Removes the element from the set.

> toArray : function()

Returns: {Array(String)} Array of elements contained in this set.

> clear : function()

Clears the set.