Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / DebugCommand.java
1 package jde.debugger.command;
2 import java.util.List;
3 import jde.debugger.JDEException;
4 import jde.debugger.Protocol;
5
6
7 /**
8  * Class of debugger commands.
9  *
10  * Command-line syntax:
11  *
12  * app_id cmd_id cmd_name [arg]*
13  *
14  * Copyright (c) 2000, 2001, 2003    Paul Kinnucan
15  *
16  * @author Paul Kinnucan
17  * @version $Revision: 1.3 $
18  */
19
20 abstract public class DebugCommand implements Protocol, Cloneable {
21
22   Integer m_cmdID;
23   String  m_cmdName;
24   List    m_args;
25
26   public DebugCommand() { }
27     
28   public void init(Integer cmdID, String cmdName, List args) throws JDEException {
29     m_cmdID   = cmdID;
30     m_cmdName = cmdName;
31     m_args    = args;
32   }
33
34   public Integer getID() {
35     return m_cmdID;
36   }
37     
38   public String toString() {
39     return m_cmdID.toString() + " " + m_cmdName;
40   }
41
42   public boolean equals(Object o) {
43     if (!(o instanceof DebugCommand)) {
44       return false;
45     }
46         
47     return m_cmdID.equals(((DebugCommand) o).getID());
48   }
49     
50   abstract protected void doCommand() throws JDEException;
51   abstract public Object clone();  
52 } // DebugCommand
53
54
55 /*
56  * $Log: DebugCommand.java,v $
57  * Revision 1.3  2003/01/15 05:56:26  paulk
58  * Add Petter Mahlen's changes.
59  *
60  * Revision 1.2  2001/03/24 05:42:36  paulk
61  * Updated to reflect reorganization of debugger code.
62  *
63  * Revision 1.1  2000/01/30 12:31:51  paulk
64  * Initial revision.
65  *
66  */
67
68 // End of DebugCommand.java