MathWorx

Class Set

Object
   |
   +--Set

class Set

Defined in Set.js


Field Summary
 Integer cardinality
          the cardinality ("dimension") of the set
 Array elements
          the elements of the set
<static>  <final> Set empty
          the empty set {}
 
Constructor Summary
Set(<Object> elements)
            Constructor function for a new set.
 
Method Summary
 void addElement(<Object> el)
           Adds a new element to the set and updates the cardinality.
 Set cartesianProduct(<Set> set)
           Calculates the Cartesian product of two sets (the set of all ordered pairs, which are here treated as subsets.
 Set complement(<Set> set)
           Creates a new set that is the relative complement of two sets.
 Boolean equalTo(<Set> set)
           Tests whether or not two sets (including subsets, which must be defined as sets and not simply arrays) are equal.
 Number indexOf(<Object> el)
           Finds the index of the first occurence of the specified element.
 Boolean inSet(el)
           Determines if a specified element is in the set of this group.
 Set intersection(<Set> set)
           Creates a new set out of the intersection (shared elements) of two sets.
 Boolean properSubsetOf(<Set> set)
           Tests if this set is a proper subset of a given set (i.e.
 Boolean properSupersetOf(<Set> set)
           Tests whether or not this set is a proper superset of a given set.
 void removeElement(<Object> el)
           Removes ALL OCCURENCES of an element from the set and updates the cardinality.
 Boolean subsetOf(<Set> set)
           Tests to see if a set is a subset (not necessarily a proper subset; i.e.
 Boolean supersetOf(<Set> set)
           Tests if the set is a superset of a given set.
 String toString()
           Returns a string representation of the set (and subsets).
 Set union(<Set> set)
           Creates a new set that is the union of two sets.
<static> Set zero(<Integer> n)
           Creates a set with n zero elements

Field Detail

cardinality

Integer cardinality

elements

Array elements

empty

<static> <final> Set empty

Constructor Detail

Set

Set(<Object> elements)

Method Detail

addElement

void addElement(<Object> el)

cartesianProduct

Set cartesianProduct(<Set> set)

complement

Set complement(<Set> set)

equalTo

Boolean equalTo(<Set> set)

indexOf

Number indexOf(<Object> el)

inSet

Boolean inSet(el)

intersection

Set intersection(<Set> set)

properSubsetOf

Boolean properSubsetOf(<Set> set)

properSupersetOf

Boolean properSupersetOf(<Set> set)

removeElement

void removeElement(<Object> el)

subsetOf

Boolean subsetOf(<Set> set)

supersetOf

Boolean supersetOf(<Set> set)

toString

String toString()

union

Set union(<Set> set)

zero

<static> Set zero(<Integer> n)

MathWorx

Documentation generated by JSDoc on Tue Aug 5 10:22:22 2008