org.fraid.function
Class GeneratorFunction

java.lang.Object
  extended by org.fraid.function.ComplexFunction
      extended by org.fraid.function.GeneratorFunction
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.ChangeListener
Direct Known Subclasses:
appendS, cft, conv, dft, dft1, DisconnectedGeneratorFunction, fft, fft1, firResp, histogramS, icft, idft, idft1, ifft, ifft1, inverseFilter, loadS, loadSound, padS, randS, recordSound, reverseFilter, sampleL, sampleN, samples, shrotS, truncateS, vector

public abstract class GeneratorFunction
extends ComplexFunction
implements javax.swing.event.ChangeListener

See Also:
Serialized Form

Field Summary
protected  Complex[] mArgs
           
protected  DefinedFunction mRegisteredFunction
           
 
Fields inherited from class org.fraid.function.ComplexFunction
mName, mNumberOfArguments
 
Constructor Summary
GeneratorFunction()
           
 
Method Summary
 java.lang.Object clone()
          Used when a panel is cloned to be saved in a file.
 int detouchFromListeners()
           
protected abstract  DefinedFunction generate(Complex[] args)
           
 void getDependancies(java.util.Vector<ComplexFunction> aVector, java.util.HashSet<ComplexFunction> aAllreadyPassed)
          Get all the functions this GeneratorFunction depends on (is defined using).
 DefinedFunction getRegisteredFunction()
           
 Complex invoke(Complex[] args)
          The actual call to the function.
 void postProcess()
           
protected  DefinedFunction processAndAttach(Complex[] aArgs)
           
 void regenerateRegisteredFunction()
           
 void setRegisteredFunction(DefinedFunction aDf)
           
 void stateChanged(javax.swing.event.ChangeEvent aEvent)
           
 java.lang.String toString()
          The String representataion (DefinedFunction gives you back the complete definition).
 
Methods inherited from class org.fraid.function.ComplexFunction
exec, getDependancies, getName, getNumberOfArguments, getSignature, setName, setNumberOfArguments
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mRegisteredFunction

protected DefinedFunction mRegisteredFunction

mArgs

protected Complex[] mArgs
Constructor Detail

GeneratorFunction

public GeneratorFunction()
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: ComplexFunction
Used when a panel is cloned to be saved in a file. The clone is transient (not included in the symbtable). This ensures the function won't change while we are generating large files.

Overrides:
clone in class ComplexFunction
Returns:
an Object value
Throws:
java.lang.CloneNotSupportedException - if an error occurs

generate

protected abstract DefinedFunction generate(Complex[] args)
                                     throws ComplexFunctionException
Throws:
ComplexFunctionException

invoke

public Complex invoke(Complex[] args)
               throws ComplexFunctionException
Description copied from class: ComplexFunction
The actual call to the function.

Specified by:
invoke in class ComplexFunction
Parameters:
args - the arguments, can be (and usualy are) SimpleNode's
Returns:
a Complex value
Throws:
ComplexFunctionException
See Also:
SimpleNode

processAndAttach

protected DefinedFunction processAndAttach(Complex[] aArgs)
                                    throws ComplexFunctionException
Throws:
ComplexFunctionException

postProcess

public void postProcess()
                 throws ComplexFunctionException
Throws:
ComplexFunctionException

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent aEvent)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

regenerateRegisteredFunction

public void regenerateRegisteredFunction()

getRegisteredFunction

public DefinedFunction getRegisteredFunction()

setRegisteredFunction

public void setRegisteredFunction(DefinedFunction aDf)

detouchFromListeners

public int detouchFromListeners()

toString

public java.lang.String toString()
Description copied from class: ComplexFunction
The String representataion (DefinedFunction gives you back the complete definition).

Overrides:
toString in class ComplexFunction
Returns:
a String value
See Also:
DefinedFunction

getDependancies

public void getDependancies(java.util.Vector<ComplexFunction> aVector,
                            java.util.HashSet<ComplexFunction> aAllreadyPassed)
Get all the functions this GeneratorFunction depends on (is defined using). This takes care of the GeneratorFunction args, for the rest see SimpleNode.getDependancies(...).

Parameters:
aVector - a vector containing all the functions this node depends on (output value)
aAllreadyPassed - helper - a hash set of the already processed functions (to prevent duplicates in the output list)


Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.