net.sf.tomp.xtcl.command
Class Remove

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

public class Remove
extends AbstractCommand

Removes referenced objects (usually variables) from Context. If any referenced object is not found, terminates and returns 1; otherwise 0.

Author:
tomp

Field Summary
protected  java.lang.String[] removes
          Array of names of objects to be removed.
 
Constructor Summary
Remove()
           
 
Method Summary
 int execute(Context context)
          Removes referenced objects (usually variables) from Context.
 void setRemoves(java.lang.String[] r)
          set Array of names of objects to be removed.
 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

removes

protected java.lang.String[] removes
Array of names of objects to be removed.

Constructor Detail

Remove

public Remove()
Method Detail

setRemoves

public void setRemoves(java.lang.String[] r)
set Array of names of objects to be removed.

Parameters:
r - Array of names of objects to be removed.

execute

public int execute(Context context)
            throws java.lang.Exception
Removes referenced objects (usually variables) from Context. If any referenced object is not found, terminates and returns 1; otherwise 0.

Specified by:
execute in interface Command
Overrides:
execute in class AbstractCommand
Parameters:
context - Context this command will be executed in.
Returns:
always 0 == success, OK
Throws:
java.lang.Exception - only if I/O error occurs when reporting the result to user.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
"REMOVE (" + listArray(removes) + ")";


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