Class Collections.Set

Set

Class Summary
Constructor Attributes Constructor Name and Description
 
A Set is a Collection that cannot contain duplicate elements.

Method Summary

Class Detail

Collections.Set()
A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set class adds and restricts the duplicate elements added. Two Set instances are equal if they contain the same elements
require('Collections').Set()

Method Detail

  • <static> Collections.Set.add(item)
    Adds the specified element to this set if it is not already present.
    Parameters:
    {Object} item
    Returns:
    null
  • <static> Collections.Set.addAll(itemArray)
    Adds an array of elements to the Collection, and dicarded if teh item already present
    Parameters:
    {Object[]} itemArray
    Returns:
    null
  • <static> {Collections.Set} Collections.Set.clone()
    returns Collection.Set a new set with the cloned object of the items.
    Returns:
    {Collections.Set}
  • <static> {boolean} Collections.Set.contains(Item)
    returns true if teh provided item already present in the collection set.
    Parameters:
    {Object} Item
    Returns:
    {boolean}
  • <static> {boolean} Collections.Set.containsAll(ItemArray)
    returns true if teh provided all items already present in the collection set.
    Parameters:
    {Object[]} ItemArray
    Returns:
    {boolean}
  • <static> {Object[]} Collections.Set.getElements()
    returns the elemnts in teh Set as an Array [] of elements
    Returns:
    {Object[]}
  • <static> {intersectionSet} Collections.Set.intersect(ItemsSet)
    returns a set of items common to both teh sets.
    Parameters:
    {Collection.Set} ItemsSet
    Returns:
    {intersectionSet}
  • <static> {diffSet} Collections.Set.minus(ItemsSet)
    removes item available in the itemSet from the currentSet
    Parameters:
    {Collection.Set} ItemsSet
    Returns:
    {diffSet}
  • <static> {String} Collections.Set.objType()
    returns the Object Type as "Set"
    Returns:
    {String}
  • <static> {null} Collections.Set.remove(Item)
    removes item from teh Collection.Set
    Parameters:
    {Object} Item
    Returns:
    {null}
  • <static> {Integer} Collections.Set.size()
    returns the size of the set.
    Returns:
    {Integer}
  • <static> {String} Collections.Set.toString()
    returns JSON Notation of the items in teh set.
    Returns:
    {String}