Browse Source

1995 called and they want their collection types back

Change-Id: I5d76244f67d380b350853aff05a3c0af731d892b
Reviewed-on: http://gerrit.dmdirc.com/1359
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.4^0
Chris Smith 14 years ago
parent
commit
700af39924

+ 2
- 2
src/com/dmdirc/parser/common/CallbackManager.java View File

@@ -26,7 +26,7 @@ import com.dmdirc.parser.interfaces.Parser;
26 26
 import com.dmdirc.parser.interfaces.SpecificCallback;
27 27
 import com.dmdirc.parser.interfaces.callbacks.*;
28 28
 
29
-import java.util.Hashtable;
29
+import java.util.HashMap;
30 30
 import java.util.Map;
31 31
 
32 32
 /**
@@ -72,7 +72,7 @@ public abstract class CallbackManager<T extends Parser> {
72 72
     
73 73
     /** Hashtable used to store the different types of callback known. */
74 74
     private final Map<Class<? extends CallbackInterface>, CallbackObject> callbackHash
75
-            = new Hashtable<Class<? extends CallbackInterface>, CallbackObject>();
75
+            = new HashMap<Class<? extends CallbackInterface>, CallbackObject>();
76 76
 
77 77
     /**
78 78
      * Constructor to create a CallbackManager.

+ 4
- 3
src/com/dmdirc/parser/common/CallbackObjectSpecific.java View File

@@ -29,7 +29,8 @@ import com.dmdirc.parser.interfaces.callbacks.CallbackInterface;
29 29
 
30 30
 import java.util.ArrayList;
31 31
 import java.util.Date;
32
-import java.util.Hashtable;
32
+import java.util.HashMap;
33
+import java.util.Map;
33 34
 
34 35
 /**
35 36
  * CallbackObjectSpecific.
@@ -40,8 +41,8 @@ import java.util.Hashtable;
40 41
 public abstract class CallbackObjectSpecific extends CallbackObject {
41 42
 
42 43
     /** Hashtable for storing specific information for callback. */
43
-    protected volatile Hashtable<CallbackInterface, String> specificData
44
-            = new Hashtable<CallbackInterface, String>();
44
+    protected final Map<CallbackInterface, String> specificData
45
+            = new HashMap<CallbackInterface, String>();
45 46
 
46 47
     /**
47 48
      * Create a new instance of the Callback Object.

+ 3
- 4
src/com/dmdirc/parser/irc/IRCChannelInfo.java View File

@@ -34,7 +34,6 @@ import java.util.ArrayList;
34 34
 import java.util.Collection;
35 35
 import java.util.Collections;
36 36
 import java.util.HashMap;
37
-import java.util.Hashtable;
38 37
 import java.util.LinkedList;
39 38
 import java.util.List;
40 39
 import java.util.Map;
@@ -75,11 +74,11 @@ public class IRCChannelInfo implements ChannelInfo {
75 74
     private final String sName;
76 75
 
77 76
     /** Hashtable containing references to ChannelClients. */
78
-    private final Map<String, IRCChannelClientInfo> hChannelUserList = Collections.synchronizedMap(new Hashtable<String, IRCChannelClientInfo>());
77
+    private final Map<String, IRCChannelClientInfo> hChannelUserList = Collections.synchronizedMap(new HashMap<String, IRCChannelClientInfo>());
79 78
     /** Hashtable storing values for modes set in the channel that use parameters. */
80
-    private final Map<Character, String> hParamModes = new Hashtable<Character, String>();
79
+    private final Map<Character, String> hParamModes = new HashMap<Character, String>();
81 80
     /** Hashtable storing list modes. */
82
-    private final Map<Character, ArrayList<ChannelListModeItem>> hListModes = new Hashtable<Character, ArrayList<ChannelListModeItem>>();
81
+    private final Map<Character, ArrayList<ChannelListModeItem>> hListModes = new HashMap<Character, ArrayList<ChannelListModeItem>>();
83 82
     /**
84 83
      * LinkedList storing status of mode adding.
85 84
      * if an item is in this list for a mode, we are expecting new items for the list

+ 1
- 2
src/com/dmdirc/parser/irc/IRCClientInfo.java View File

@@ -28,7 +28,6 @@ import com.dmdirc.parser.interfaces.Parser;
28 28
 
29 29
 import java.util.ArrayList;
30 30
 import java.util.HashMap;
31
-import java.util.Hashtable;
32 31
 import java.util.LinkedList;
33 32
 import java.util.List;
34 33
 import java.util.Map;
@@ -62,7 +61,7 @@ public class IRCClientInfo implements LocalClientInfo {
62 61
     /** A Map to allow applications to attach misc data to this object */
63 62
     private Map<Object, Object> myMap;
64 63
     /** List of ChannelClientInfos that point to this */
65
-    private final Map<String, IRCChannelClientInfo> myChannelClientInfos = new Hashtable<String, IRCChannelClientInfo>();
64
+    private final Map<String, IRCChannelClientInfo> myChannelClientInfos = new HashMap<String, IRCChannelClientInfo>();
66 65
     /** Modes waiting to be sent to the server. */
67 66
     private final List<String> lModeQueue = new LinkedList<String>();
68 67
 

+ 8
- 9
src/com/dmdirc/parser/irc/IRCParser.java View File

@@ -49,7 +49,6 @@ import java.util.Arrays;
49 49
 import java.util.Collection;
50 50
 import java.util.Collections;
51 51
 import java.util.HashMap;
52
-import java.util.Hashtable;
53 52
 import java.util.LinkedList;
54 53
 import java.util.List;
55 54
 import java.util.Map;
@@ -160,16 +159,16 @@ public class IRCParser implements SecureParser, Runnable {
160 159
     private int connectTimeout = 5000;
161 160
 
162 161
     /** Hashtable storing known prefix modes (ohv). */
163
-    final Map<Character, Long> prefixModes = new Hashtable<Character, Long>();
162
+    final Map<Character, Long> prefixModes = new HashMap<Character, Long>();
164 163
     /**
165 164
      * Hashtable maping known prefix modes (ohv) to prefixes (@%+) - Both ways.
166 165
      * Prefix map contains 2 pairs for each mode. (eg @ => o and o => @)
167 166
      */
168
-    final Map<Character, Character> prefixMap = new Hashtable<Character, Character>();
167
+    final Map<Character, Character> prefixMap = new HashMap<Character, Character>();
169 168
     /** Integer representing the next avaliable integer value of a prefix mode. */
170 169
     long nextKeyPrefix = 1;
171 170
     /** Hashtable storing known user modes (owxis etc). */
172
-    final Map<Character, Long> userModes = new Hashtable<Character, Long>();
171
+    final Map<Character, Long> userModes = new HashMap<Character, Long>();
173 172
     /** Integer representing the next avaliable integer value of a User mode. */
174 173
     long nNextKeyUser = 1;
175 174
     /**
@@ -180,7 +179,7 @@ public class IRCParser implements SecureParser, Runnable {
180 179
      * <br>
181 180
      * Channel modes discovered but not listed in 005 are stored as boolean modes automatically (and a ERROR_WARNING Error is called)
182 181
      */
183
-    final Map<Character, Long> chanModesBool = new Hashtable<Character, Long>();
182
+    final Map<Character, Long> chanModesBool = new HashMap<Character, Long>();
184 183
     /** Integer representing the next avaliable integer value of a Boolean mode. */
185 184
 
186 185
     long nextKeyCMBool = 1;
@@ -194,7 +193,7 @@ public class IRCParser implements SecureParser, Runnable {
194 193
      * see MODE_SET<br>
195 194
      * see MODE_UNSET<br>
196 195
      */
197
-    final Map<Character, Byte> chanModesOther = new Hashtable<Character, Byte>();
196
+    final Map<Character, Byte> chanModesOther = new HashMap<Character, Byte>();
198 197
 
199 198
     /** The last line of input recieved from the server */
200 199
     String lastLine = "";
@@ -204,13 +203,13 @@ public class IRCParser implements SecureParser, Runnable {
204 203
     /** Channel Prefixes (ie # + etc). */
205 204
     private final List<Character> chanPrefix = Collections.synchronizedList(new LinkedList<Character>());
206 205
     /** Hashtable storing all known clients based on nickname (in lowercase). */
207
-    private final Map<String, IRCClientInfo> clientList = new Hashtable<String, IRCClientInfo>();
206
+    private final Map<String, IRCClientInfo> clientList = new HashMap<String, IRCClientInfo>();
208 207
     /** Hashtable storing all known channels based on chanel name (inc prefix - in lowercase). */
209
-    private final Map<String, IRCChannelInfo> channelList = new Hashtable<String, IRCChannelInfo>();
208
+    private final Map<String, IRCChannelInfo> channelList = new HashMap<String, IRCChannelInfo>();
210 209
     /** Reference to the ClientInfo object that references ourself. */
211 210
     private IRCClientInfo myself = new IRCClientInfo(this, "myself").setFake(true);
212 211
     /** Hashtable storing all information gathered from 005. */
213
-    final Map<String, String> h005Info = new Hashtable<String, String>();
212
+    final Map<String, String> h005Info = new HashMap<String, String>();
214 213
 
215 214
     /** Ignore List. */
216 215
     IgnoreList myIgnoreList = new IgnoreList();

+ 3
- 2
src/com/dmdirc/parser/irc/ProcessingManager.java View File

@@ -24,7 +24,8 @@ package com.dmdirc.parser.irc;
24 24
 
25 25
 import com.dmdirc.parser.common.ParserError;
26 26
 import com.dmdirc.parser.interfaces.callbacks.NumericListener;
27
-import java.util.Hashtable;
27
+import java.util.HashMap;
28
+import java.util.Map;
28 29
 
29 30
 /**
30 31
  * IRC Parser Processing Manager.
@@ -37,7 +38,7 @@ public class ProcessingManager {
37 38
     IRCParser myParser;
38 39
 
39 40
     /** Hashtable used to store the different types of IRCProcessor known. */
40
-    private final Hashtable<String, IRCProcessor> processHash = new Hashtable<String, IRCProcessor>();
41
+    private final Map<String, IRCProcessor> processHash = new HashMap<String, IRCProcessor>();
41 42
 
42 43
     /**
43 44
      * Debugging Data to the console.

Loading…
Cancel
Save