Преглед на файлове

RegexStringList->IgnoreList

Issue 2736
tags/0.6.3m2a1
Chris Smith преди 15 години
родител
ревизия
cb65d5795d

+ 2
- 2
src/com/dmdirc/IgnoreList.java Целия файл

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.parser.irc.RegexStringList;
25
+import com.dmdirc.parser.common.IgnoreList;
26 26
 
27 27
 import java.util.ArrayList;
28 28
 import java.util.List;
@@ -33,7 +33,7 @@ import java.util.List;
33 33
  *
34 34
  * @author chris
35 35
  */
36
-public class IgnoreList extends RegexStringList {
36
+public class IgnoreList extends IgnoreList {
37 37
 
38 38
     /**
39 39
      * Creates a new instance of IgnoreList.

+ 0
- 1
src/com/dmdirc/Invite.java Целия файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.parser.interfaces.ClientInfo;
26 25
 import java.util.Date;
27 26
 
28 27
 /**

src/com/dmdirc/parser/irc/RegexStringList.java → src/com/dmdirc/parser/common/IgnoreList.java Целия файл

@@ -20,18 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package com.dmdirc.parser.irc;
23
+package com.dmdirc.parser.common;
24 24
 
25 25
 import java.util.ArrayList;
26 26
 import java.util.List;
27 27
 import java.util.regex.PatternSyntaxException;
28 28
 
29 29
 /**
30
- * IRC Parser Ignore list.
30
+ * Parser Ignore list.
31 31
  *
32 32
  * @author Shane Mc Cormack
33 33
  */
34
-public class RegexStringList {
34
+public class IgnoreList {
35 35
 
36 36
 	/** Arraylist storing ignore patterns. */
37 37
 	protected final List<String> ignoreInfo = new ArrayList<String>();
@@ -39,7 +39,7 @@ public class RegexStringList {
39 39
 	/**
40 40
 	 * Creates a new instance of RegexStringList.
41 41
 	 */
42
-	public RegexStringList() {
42
+	public IgnoreList() {
43 43
 		// Do nothing
44 44
 	}
45 45
 
@@ -48,7 +48,7 @@ public class RegexStringList {
48 48
 	 *
49 49
 	 * @param items Items to add to this RegexStringList
50 50
 	 */
51
-	public RegexStringList(final List<String> items) {
51
+	public IgnoreList(final List<String> items) {
52 52
 		addAll(items);
53 53
 	}
54 54
 

+ 3
- 3
src/com/dmdirc/parser/interfaces/Parser.java Целия файл

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.parser.interfaces;
24 24
 
25 25
 import com.dmdirc.parser.irc.IRCStringConverter;
26
-import com.dmdirc.parser.irc.RegexStringList;
26
+import com.dmdirc.parser.common.IgnoreList;
27 27
 import com.dmdirc.parser.common.CallbackManager;
28 28
 
29 29
 import java.util.Collection;
@@ -307,14 +307,14 @@ public interface Parser extends Runnable {
307 307
      *
308 308
      * @param ignoreList The new ignore list to be used by the parser
309 309
      */
310
-    void setIgnoreList(RegexStringList ignoreList);
310
+    void setIgnoreList(IgnoreList ignoreList);
311 311
 
312 312
     /**
313 313
      * Retrieves the ignore list which is currently in use by this parser.
314 314
      *
315 315
      * @return This parser's ignore list
316 316
      */
317
-    RegexStringList getIgnoreList();
317
+    IgnoreList getIgnoreList();
318 318
 
319 319
     /**
320 320
      * Parses the specified hostmask into an array containing a nickname,

+ 4
- 3
src/com/dmdirc/parser/irc/IRCParser.java Целия файл

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.common.IgnoreList;
25 26
 import com.dmdirc.parser.common.ParserError;
26 27
 import com.dmdirc.parser.interfaces.SecureParser;
27 28
 import com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener;
@@ -215,7 +216,7 @@ public class IRCParser implements SecureParser, Runnable {
215 216
 	final Map<String, String> h005Info = new Hashtable<String, String>();
216 217
 
217 218
 	/** Ignore List. */
218
-	RegexStringList myIgnoreList = new RegexStringList();
219
+	IgnoreList myIgnoreList = new IgnoreList();
219 220
 
220 221
 	/** Reference to the callback Manager. */
221 222
 	CallbackManager<IRCParser> myCallbackManager = new IRCCallbackManager(this);
@@ -410,11 +411,11 @@ public class IRCParser implements SecureParser, Runnable {
410 411
 
411 412
 	/** {@inheritDoc} */
412 413
 	@Override
413
-	public RegexStringList getIgnoreList() { return myIgnoreList; }
414
+	public IgnoreList getIgnoreList() { return myIgnoreList; }
414 415
 
415 416
 	/** {@inheritDoc} */
416 417
 	@Override
417
-	public void setIgnoreList(final RegexStringList ignoreList) { myIgnoreList = ignoreList; }
418
+	public void setIgnoreList(final IgnoreList ignoreList) { myIgnoreList = ignoreList; }
418 419
 
419 420
 	//---------------------------------------------------------------------------
420 421
 	// Start Callbacks

+ 8
- 7
test/com/dmdirc/parser/irc/RegexStringListTest.java Целия файл

@@ -21,6 +21,7 @@
21 21
  */
22 22
 package com.dmdirc.parser.irc;
23 23
 
24
+import com.dmdirc.parser.common.IgnoreList;
24 25
 import java.util.ArrayList;
25 26
 import java.util.List;
26 27
 import org.junit.Test;
@@ -30,7 +31,7 @@ public class RegexStringListTest {
30 31
 
31 32
     @Test
32 33
     public void testAdd() {
33
-        final RegexStringList list = new RegexStringList();
34
+        final IgnoreList list = new IgnoreList();
34 35
         list.add("a!b@c");
35 36
         list.add("a!b@c");
36 37
         list.add("A!B@c");
@@ -47,7 +48,7 @@ public class RegexStringListTest {
47 48
         tempList.add("A!B@C");
48 49
         tempList.add("Data.*");
49 50
 
50
-        final RegexStringList list = new RegexStringList(tempList);
51
+        final IgnoreList list = new IgnoreList(tempList);
51 52
 
52 53
         assertEquals(2, list.count());
53 54
         assertEquals("a!b@c", list.get(0));
@@ -60,7 +61,7 @@ public class RegexStringListTest {
60 61
         tempList.add("a!b@c");
61 62
         tempList.add("Data.*");
62 63
 
63
-        final RegexStringList list = new RegexStringList(tempList);
64
+        final IgnoreList list = new IgnoreList(tempList);
64 65
         list.remove(0);
65 66
         list.remove(17);
66 67
 
@@ -74,7 +75,7 @@ public class RegexStringListTest {
74 75
         tempList.add("a!b@c");
75 76
         tempList.add("Data.*");
76 77
 
77
-        final RegexStringList list = new RegexStringList(tempList);
78
+        final IgnoreList list = new IgnoreList(tempList);
78 79
         list.clear();
79 80
 
80 81
         assertEquals(0, list.count());
@@ -86,7 +87,7 @@ public class RegexStringListTest {
86 87
         tempList.add("a!b@c");
87 88
         tempList.add("Data.*");
88 89
 
89
-        final RegexStringList list = new RegexStringList(tempList);
90
+        final IgnoreList list = new IgnoreList(tempList);
90 91
 
91 92
         assertTrue(list.matches("a!b@c") == 0);
92 93
         assertTrue(list.matches("foo") == -1);
@@ -97,7 +98,7 @@ public class RegexStringListTest {
97 98
     
98 99
     @Test
99 100
     public void testGet() {
100
-        final RegexStringList list = new RegexStringList();
101
+        final IgnoreList list = new IgnoreList();
101 102
         list.add("a!b@c");
102 103
         assertEquals("a!b@c", list.get(0));
103 104
         assertEquals("", list.get(7));
@@ -105,7 +106,7 @@ public class RegexStringListTest {
105 106
 
106 107
     @Test
107 108
     public void testSet() {
108
-        final RegexStringList list = new RegexStringList();
109
+        final IgnoreList list = new IgnoreList();
109 110
         list.add("a!b@c");
110 111
         list.set(0, "moo");
111 112
         list.set(1, "bar");

Loading…
Отказ
Запис