All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.DiscreteSet

java.lang.Object
   |
   +----JSci.maths.DiscreteSet

public class DiscreteSet
extends Object
implements MathSet
The DiscreteSet class provides an encapsulation for discrete sets.


Variable Index

 o elements
The set elements.

Constructor Index

 o DiscreteSet(String)
Constructs a discrete set.
 o DiscreteSet(String, Object[])
Constructs a discrete set.

Method Index

 o equals(Object)
Compares two sets for equality.
 o getElement(int)
Returns an element from within the set.
 o intersect(MathSet)
Performs the intersection of this set with another.
 o size()
Returns the number of elements in the set.
 o toString()
Returns a string representing this set.
 o union(MathSet)
Performs the union of this set with another.

Variables

 o elements
 protected Object elements[]
The set elements.

Constructors

 o DiscreteSet
 protected DiscreteSet(String aLabel)
Constructs a discrete set.

Parameters:
aLabel - a label that identifies this set
 o DiscreteSet
 public DiscreteSet(String aLabel,
                    Object array[])
Constructs a discrete set.

Parameters:
aLabel - a label that identifies this set
array - an array containing the set elements

Methods

 o equals
 public boolean equals(Object s)
Compares two sets for equality.

Overrides:
equals in class Object
 o toString
 public final String toString()
Returns a string representing this set.

Overrides:
toString in class Object
 o size
 public final int size()
Returns the number of elements in the set.

 o getElement
 public final Object getElement(int n)
Returns an element from within the set.

Parameters:
n - index of the element
 o union
 public MathSet union(MathSet set)
Performs the union of this set with another.

Parameters:
set - a discrete set
Returns:
the union of the two sets
 o intersect
 public MathSet intersect(MathSet set)
Performs the intersection of this set with another.

Parameters:
set - a discrete set
Returns:
the intersection of the two sets

All Packages  Class Hierarchy  This Package  Previous  Next  Index