org.rubato.logeo
Class Sets

java.lang.Object
  extended by org.rubato.logeo.Sets

public final class Sets
extends java.lang.Object

This static class implements the usual set operations on denotators of type power.

Author:
Gérard Milmeister

Method Summary
static PowerDenotator addElement(PowerDenotator d, Denotator element)
           
static PowerDenotator addElements(PowerDenotator d, Denotator... elements)
           
static PowerDenotator addElements(PowerDenotator d, java.util.List<Denotator> elements)
           
static PowerDenotator cartesian(PowerForm resForm, PowerDenotator d1, PowerDenotator d2)
          Returns the Cartesian product of two denotators of type power.
static boolean contains(PowerDenotator p, Denotator d)
          Returns true iff p contains d.
static PowerDenotator difference(PowerDenotator... denoList)
          Returns the set difference of argument list of denotators.
static PowerDenotator difference(PowerDenotator d1, PowerDenotator d2)
          Returns the set difference of argument denotators.
static Denotator disjointUnion(PowerDenotator d1, PowerDenotator d2)
          Returns the disjoint union of two denotators of type power.
static PowerDenotator intersection(PowerDenotator... denoList)
          Returns the set intersection of argument list of denotators.
static PowerDenotator intersection(PowerDenotator d1, PowerDenotator d2)
          Returns the set intersection of argument denotators.
static Denotator map(Function f, PowerDenotator d)
          Return a denotator, where the function f is applied on the elements of the argument denotator.
static Denotator select(Predicate p, PowerDenotator d)
          Returns a denotator, where only the elements from the argument denotator are contained that satisfy predicate p.
static boolean subset(PowerDenotator d1, PowerDenotator d2)
          Returns true iff d1 is a subset of d2.
static PowerDenotator symmetric(PowerDenotator... denoList)
          Returns the symmetric set difference of argument list of denotators.
static PowerDenotator symmetric(PowerDenotator d1, PowerDenotator d2)
          Returns the symmetric set difference of argument denotators.
static PowerDenotator union(PowerDenotator... denoList)
          Returns the set union of argument list of denotators.
static PowerDenotator union(PowerDenotator d1, PowerDenotator d2)
          Returns the set union of the specified power denotators.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

union

public static PowerDenotator union(PowerDenotator d1,
                                   PowerDenotator d2)
                            throws RubatoException
Returns the set union of the specified power denotators.

Throws:
RubatoException - if d1 or d2 is not of the required form

union

public static PowerDenotator union(PowerDenotator... denoList)
                            throws RubatoException
Returns the set union of argument list of denotators.

Parameters:
denoList - input array of power denotators must have length > 0 and must have no null elements
Throws:
RubatoException - if the denotators do not have the required form

intersection

public static PowerDenotator intersection(PowerDenotator d1,
                                          PowerDenotator d2)
                                   throws RubatoException
Returns the set intersection of argument denotators.

Throws:
RubatoException - if d1 and d2 are not of the required form

intersection

public static PowerDenotator intersection(PowerDenotator... denoList)
                                   throws RubatoException
Returns the set intersection of argument list of denotators.

Parameters:
denoList - input array of power denotators must have length > 0 and must have no null elements
Throws:
RubatoException - if the denotators have not the required form

difference

public static PowerDenotator difference(PowerDenotator d1,
                                        PowerDenotator d2)
                                 throws RubatoException
Returns the set difference of argument denotators.

Throws:
RubatoException - if d1 and d2 are not of the required form

difference

public static PowerDenotator difference(PowerDenotator... denoList)
                                 throws RubatoException
Returns the set difference of argument list of denotators.

Throws:
RubatoException - if the denotators have not the required form

symmetric

public static PowerDenotator symmetric(PowerDenotator d1,
                                       PowerDenotator d2)
                                throws RubatoException
Returns the symmetric set difference of argument denotators.

Throws:
RubatoException - if d1 and d2 are not of the required form

symmetric

public static PowerDenotator symmetric(PowerDenotator... denoList)
                                throws RubatoException
Returns the symmetric set difference of argument list of denotators.

Throws:
RubatoException - if the denotators have not the required form

map

public static Denotator map(Function f,
                            PowerDenotator d)
                     throws RubatoException
Return a denotator, where the function f is applied on the elements of the argument denotator.

Parameters:
f - the function to apply to the arguments, must have arity 1
Throws:
RubatoException - if d is not of type power or f has arity != 1

select

public static Denotator select(Predicate p,
                               PowerDenotator d)
                        throws RubatoException
Returns a denotator, where only the elements from the argument denotator are contained that satisfy predicate p.

Parameters:
p - the predicate that the elements must satisfy, must have arity 1
Throws:
RubatoException - if d is not of type power or p has arity != 1

cartesian

public static PowerDenotator cartesian(PowerForm resForm,
                                       PowerDenotator d1,
                                       PowerDenotator d2)
                                throws RubatoException
Returns the Cartesian product of two denotators of type power.

Throws:
RubatoException - if d1 or d2 is not of type power

disjointUnion

public static Denotator disjointUnion(PowerDenotator d1,
                                      PowerDenotator d2)
                               throws RubatoException
Returns the disjoint union of two denotators of type power.

Throws:
RubatoException - if d1 or d2 is not of type power

addElement

public static PowerDenotator addElement(PowerDenotator d,
                                        Denotator element)
                                 throws RubatoException
Throws:
RubatoException

addElements

public static PowerDenotator addElements(PowerDenotator d,
                                         Denotator... elements)
                                  throws RubatoException
Throws:
RubatoException

addElements

public static PowerDenotator addElements(PowerDenotator d,
                                         java.util.List<Denotator> elements)
                                  throws RubatoException
Throws:
RubatoException

subset

public static boolean subset(PowerDenotator d1,
                             PowerDenotator d2)
Returns true iff d1 is a subset of d2.


contains

public static boolean contains(PowerDenotator p,
                               Denotator d)
Returns true iff p contains d.