de.rwth.domains.templates
Class FunctionSet

java.lang.Object
  |
  +--de.rwth.domains.templates.FunctionSet
All Implemented Interfaces:
Set
Direct Known Subclasses:
FunctionPOSet

public class FunctionSet
extends java.lang.Object
implements Set

Class for the creation of sets of functions with other finite (partially ordered) sets as domain and range.

Version:
$Id: FunctionSet.java,v 1.2 2002/09/17 06:53:53 mohnen Exp $
Author:
Markus Mohnen

Inner classes inherited from class de.rwth.domains.Set
Set.Default
 
Field Summary
protected  Set domain
          The domain of the functions in this set.
protected  Set range
          The range of the functions in this set.
 
Constructor Summary
FunctionSet(Set[] domains, Set range)
          Create a function set from an array of domains and a range.
FunctionSet(Set domain, Set range)
          Create a function set from a domain and a range.
 
Method Summary
 boolean equals(java.lang.Object e1, java.lang.Object e2)
          Checks if a function equals another function of this set.
 boolean isElement(java.lang.Object e)
          Checks if an element is contained in this set.
 java.util.Iterator iterator()
          Returns an Iterator of the elements of this set.
 java.util.Iterator iteratorSkel()
          Returns an Iterator of the elements of the skeleton subset this set.
 long size()
          Returns the size of the set.
 long sizeSkel()
          Returns the size of the skeleton subset of this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domain

protected Set domain
The domain of the functions in this set.

range

protected Set range
The range of the functions in this set.
Constructor Detail

FunctionSet

public FunctionSet(Set domain,
                   Set range)
Create a function set from a domain and a range.
Parameters:
domain - a value of type Set
range - a value of type POSet

FunctionSet

public FunctionSet(Set[] domains,
                   Set range)
Create a function set from an array of domains and a range.
Parameters:
domains - a value of type Set[]
range - a value of type POSet
Method Detail

equals

public boolean equals(java.lang.Object e1,
                      java.lang.Object e2)
Checks if a function equals another function of this set. This is done argument-wise.
Specified by:
equals in interface Set
Parameters:
f1 - a value of type Object
f2 - a value of type Object
Returns:
true iff both f1 and f2 are functions in this set and for all x in the domain holds range.equals(f1(x),f2(x))

isElement

public boolean isElement(java.lang.Object e)
Description copied from interface: Set
Checks if an element is contained in this set.
Implementations should guarantee that isElement() is true for all objects generated by Set.iterator() and false for all other objects.
Specified by:
isElement in interface Set
Following copied from interface: de.rwth.domains.Set
Parameters:
e - a value of type Object
Returns:
true if and only if this set contains this element.
See Also:
Set.iterator(), Domain.checkProperties(Set set)

iterator

public java.util.Iterator iterator()
Description copied from interface: Set
Returns an Iterator of the elements of this set.
Implementations should guarantee that:
Specified by:
iterator in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
an Iterator of all elements of this set.
See Also:
Set.isElement(Object e), Domain.checkProperties(Set set)

size

public long size()
Returns the size of the set.
Specified by:
size in interface Set
Returns:
the number of elements, which is range.size()domain.size()

sizeSkel

public long sizeSkel()
Returns the size of the skeleton subset of this set.
Specified by:
sizeSkel in interface Set
Returns:
the number of skeleton elements, which is range.sizeSkel()domain.sizeSkel()

iteratorSkel

public java.util.Iterator iteratorSkel()
Description copied from interface: Set
Returns an Iterator of the elements of the skeleton subset this set. It maybe null if there is no skeleton subset.
Implementations should guarantee that:
Specified by:
iteratorSkel in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
an Iterator of all elements of this set.
See Also:
Set.isElement(Object e), Domain.checkProperties(Set set)