org.sgx.j2s.js
Class AbstractRunnable

Package class diagram package AbstractRunnable
java.lang.Object
  extended by org.sgx.j2s.js.AbstractRunnable
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Array.ArrayVisitor

public abstract class AbstractRunnable
extends java.lang.Object
implements java.lang.Runnable

Helper function for java programmers so they can define an analog concept to javascript functions. The user must override a run and indicate how many arguments its run function accepts overriding getParamCount() method. Please use JsUTils.runnableToFunc for building a javascript function object that will run this runnable


Field Summary
private  int paramCount
           
 
Constructor Summary
AbstractRunnable()
           
AbstractRunnable(int paramCount)
           
 
Method Summary
 int getParamCount()
           
 void run()
           
 java.lang.Object run0()
           
 java.lang.Object run1(java.lang.Object o1)
           
 java.lang.Object run2(java.lang.Object o1, java.lang.Object o2)
           
 java.lang.Object run3(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
           
 java.lang.Object run4(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
           
 java.lang.Object run5(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5)
           
 void setParamCount(int paramCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paramCount

private int paramCount
Constructor Detail

AbstractRunnable

public AbstractRunnable()

AbstractRunnable

public AbstractRunnable(int paramCount)
Method Detail

getParamCount

public int getParamCount()

setParamCount

public void setParamCount(int paramCount)

run

public void run()
Specified by:
run in interface java.lang.Runnable

run0

public java.lang.Object run0()

run1

public java.lang.Object run1(java.lang.Object o1)

run2

public java.lang.Object run2(java.lang.Object o1,
                             java.lang.Object o2)

run3

public java.lang.Object run3(java.lang.Object o1,
                             java.lang.Object o2,
                             java.lang.Object o3)

run4

public java.lang.Object run4(java.lang.Object o1,
                             java.lang.Object o2,
                             java.lang.Object o3,
                             java.lang.Object o4)

run5

public java.lang.Object run5(java.lang.Object o1,
                             java.lang.Object o2,
                             java.lang.Object o3,
                             java.lang.Object o4,
                             java.lang.Object o5)