/*--------------------------------------------------------------------------- -- JAWAA 2.0 -- Copyright information: Susan H. Rodger, Pretesh Patel, Ayonike Akingbade, Diana Jackson Computer Science Department Duke University August 2002 Supported by National Science Foundation DUE-9752583. Copyright (c) 2002 All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the author. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- File: nameoffile.java Package: JAWAA Version 2.0 Author: Pretesh Patel, Ayonike Akingbade, Diana Jackson Date: August 2002 Description of Contents: --------------------------------------------------------------------------*/ package jawaa.command; import jawaa.util.ErrorHandler; public class DelayCommand extends JawaaCommand { public DelayCommand(String[] args) { super("super"); try { myDelay = Integer.parseInt(args[1]); } catch (ArrayIndexOutOfBoundsException e) { ErrorHandler.error(this, "not enought arguments", true); } catch (NumberFormatException e) { ErrorHandler.error(this, "number expected", false); myDelay = 0; } catch (Exception e) { ErrorHandler.error(this, "syntax error"); } } public boolean step() { try { Thread.sleep(myDelay); } catch(Exception e) {} return false; } private int myDelay; }