org.rubato.logeo
Class Apply

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

public class Apply
extends java.lang.Object

This class implements an apply operation. A function is applied to every part of a denotator that matches some given criteria. The denotator may be modified inplace, so this should be considered a destructive operation. However an applied function does not need to modify anything and could simply collect information.

Author:
Gérard Milmeister

Method Summary
static void apply(Denotator d, Form form, Function f)
          Applies the function f to the denotator d for every part of d that matches the given form.
static void apply(Denotator d, Predicate p, Function f)
          Applies the function f to the denotator d for every part of d that satisfies the predicate p.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

apply

public static void apply(Denotator d,
                         Form form,
                         Function f)
                  throws RubatoException
Applies the function f to the denotator d for every part of d that matches the given form.

Parameters:
d - the denotator that the function is applied to
form - the form of the parts the function is applied to
f - the function that is applied
Throws:
RubatoException

apply

public static void apply(Denotator d,
                         Predicate p,
                         Function f)
                  throws RubatoException
Applies the function f to the denotator d for every part of d that satisfies the predicate p.

Parameters:
d - the denotator that the function is applied to
p - the predicate that a part must satisfy for the function to be applied
f - the function that is applied
Throws:
RubatoException