浏览代码

Merge pull request #129 from csmith/master

Add method to set output queue.
pull/130/head
Greg Holmes 8 年前
父节点
当前提交
8ac6628938
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16
    1
      irc/src/com/dmdirc/parser/irc/IRCParser.java

+ 16
- 1
irc/src/com/dmdirc/parser/irc/IRCParser.java 查看文件

84
 
84
 
85
 import dagger.ObjectGraph;
85
 import dagger.ObjectGraph;
86
 
86
 
87
+import static com.google.common.base.Preconditions.checkNotNull;
88
+
87
 /**
89
 /**
88
  * IRC Parser.
90
  * IRC Parser.
89
  */
91
  */
210
      */
212
      */
211
     private Socket rawSocket;
213
     private Socket rawSocket;
212
     /** Used for writing to the server. */
214
     /** Used for writing to the server. */
213
-    private final OutputQueue out;
215
+    private OutputQueue out;
214
     /** The encoder to use to encode incoming lines. */
216
     /** The encoder to use to encode incoming lines. */
215
     private Encoder encoder = new SystemEncoder();
217
     private Encoder encoder = new SystemEncoder();
216
     /** Used for reading from the server. */
218
     /** Used for reading from the server. */
299
         return out;
301
         return out;
300
     }
302
     }
301
 
303
 
304
+    /**
305
+     * Sets the output queue that this parser will use.
306
+     *
307
+     * <p>Any existing items in the queue will be removed.
308
+     *
309
+     * @param queue The queue to be added.
310
+     */
311
+    public void setOutputQueue(final OutputQueue queue) {
312
+        checkNotNull(queue);
313
+        out.clearQueue();
314
+        out = queue;
315
+    }
316
+
302
     @Override
317
     @Override
303
     public boolean compareURI(final URI uri) {
318
     public boolean compareURI(final URI uri) {
304
         // Get the old URI.
319
         // Get the old URI.

正在加载...
取消
保存