Sfoglia il codice sorgente

Created ChannelCommand class

Changed all private properties of Command to Protected
Added abstract method Command.execute

git-svn-id: http://svn.dmdirc.com/trunk@112 00569f92-eb28-0410-84fd-f71c24880f
tags/0.1
Chris Smith 17 anni fa
parent
commit
a8a5856486

+ 42
- 0
src/uk/org/ownage/dmdirc/commandparser/ChannelCommand.java Vedi File

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package uk.org.ownage.dmdirc.commandparser;
24
+
25
+import uk.org.ownage.dmdirc.parser.ChannelInfo;
26
+
27
+/**
28
+ *
29
+ * @author chris
30
+ */
31
+public abstract class ChannelCommand extends Command {
32
+    
33
+    protected ChannelInfo channel;
34
+    
35
+    /** Creates a new instance of ChannelCommand */
36
+    public ChannelCommand(ChannelInfo channel) {
37
+        super();
38
+        
39
+        this.channel = channel;
40
+    }
41
+        
42
+}

+ 6
- 4
src/uk/org/ownage/dmdirc/commandparser/Command.java Vedi File

@@ -26,11 +26,11 @@ package uk.org.ownage.dmdirc.commandparser;
26 26
  *
27 27
  * @author chris
28 28
  */
29
-public class Command {
29
+public abstract class Command {
30 30
     
31
-    private String name;
32
-    private int arity = 0;
33
-    private boolean polyadic;
31
+    protected String name;
32
+    protected int arity = 0;
33
+    protected boolean polyadic;
34 34
     
35 35
     /** Creates a new instance of Command */
36 36
     public Command() {
@@ -44,4 +44,6 @@ public class Command {
44 44
         }
45 45
     }
46 46
     
47
+    public abstract void Execute(String... args);
48
+    
47 49
 }

Loading…
Annulla
Salva