com.cycling74.max
Class MaxQelem

java.lang.Object
  extended by com.cycling74.max.MaxQelem

public class MaxQelem
extends Object

Background job utility class. This is used to execute code in the background that might take time to execute. Calling set will trigger/execute the "job". If set is called while the "job" is running, the "job" won't be called again.

On PDJ, a Qelem is simply a Java thread that wait to be triggered.


Constructor Summary
MaxQelem()
          Constructs a Qelem that is bound the overriden class with method name qfn.
MaxQelem(Executable exec)
          Constructs a Qelem that is bound to an executable.
MaxQelem(Object src, String method)
          Constructs a Qelem that is bound to a class with method name.
 
Method Summary
 void front()
          Puts thread in front execution.
 Executable getExecutable()
          Returns the executable object.
 void qfn()
          The callback method, otherwise it calls the 'executable' method provided in constructor.
 void release()
          Releases current Qelem and cancel the running thread.
 void set()
          Ask qfn to execute.
 void unset()
          Cancels execution of qelem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxQelem

public MaxQelem()
Constructs a Qelem that is bound the overriden class with method name qfn.


MaxQelem

public MaxQelem(Executable exec)
Constructs a Qelem that is bound to an executable.

Parameters:
exec - the executable to run

MaxQelem

public MaxQelem(Object src,
                String method)
Constructs a Qelem that is bound to a class with method name.

Parameters:
src - the object that contains the method
method - the method to execute
Method Detail

front

public void front()
Puts thread in front execution. Does nothing on PDJ


qfn

public void qfn()
The callback method, otherwise it calls the 'executable' method provided in constructor.


set

public void set()
Ask qfn to execute. If it is already set, the qfn won't be called twice.


unset

public void unset()
Cancels execution of qelem. Use with caution since it will throw an InterruptedException on PDJ.


release

public void release()
Releases current Qelem and cancel the running thread.


getExecutable

public Executable getExecutable()
Returns the executable object.

Returns:
the executble object that is bound to this Qelem


This API is based on mxj for Max/MSP by Cycling74. Please see original MXJ implementation.