net.sf.tomp.xtcl.command
Class Function

java.lang.Object
  extended by net.sf.tomp.xtcl.command.AbstractCommand
      extended by net.sf.tomp.xtcl.command.Function
All Implemented Interfaces:
Command

public class Function
extends AbstractCommand

Function command

Author:
tomp

Field Summary
protected  Command command
          the command itself
protected  java.lang.String name
          Function name
protected  java.lang.String[] params
          Function formal param names
 
Constructor Summary
Function()
           
 
Method Summary
 int execute(Context context)
          execute the function command means execute its command
 java.lang.String getName()
           
 java.lang.String getParam(int i)
          Get the i-th formal param name
 void setCommand(Command c)
          sets the command representing the function
 void setName(java.lang.String p)
          sets the function name
 void setParams(java.lang.String[] p)
          sets the function's parameter names
 java.lang.String toString()
           
 
Methods inherited from class net.sf.tomp.xtcl.command.AbstractCommand
done, initParameters, listArray, listList, listMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Function name


params

protected java.lang.String[] params
Function formal param names


command

protected Command command
the command itself

Constructor Detail

Function

public Function()
Method Detail

execute

public int execute(Context context)
            throws java.lang.Exception
execute the function command means execute its command

Specified by:
execute in interface Command
Overrides:
execute in class AbstractCommand
Parameters:
context -
Returns:
Throws:
java.lang.Exception

setName

public void setName(java.lang.String p)
sets the function name

Parameters:
p - the function name

setParams

public void setParams(java.lang.String[] p)
sets the function's parameter names

Parameters:
p - the function's parameter names

setCommand

public void setCommand(Command c)
sets the command representing the function

Parameters:
c - the command

getParam

public java.lang.String getParam(int i)
Get the i-th formal param name

Parameters:
i - formal param index
Returns:
the i-th formal param name

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
"FUNCTION " + name + " (" + listArray(params) + ") {" + command + "}";

getName

public java.lang.String getName()
Returns:
Returns the name.


Copyright © 2004-2005 Masaryk University in Brno, Faculty of Informatics, Czech Republic. All Rights Reserved.