root/Weektaken2/Weektaak3/ESB/src/hanze/ga/wt3/channels/ESBQueue.java

357361
11
	private Channel qReceiverChannel;
11
	private Channel qReceiverChannel;
12
	private Queue<String> queue = new LinkedList<String>();
12
	private Queue<String> queue = new LinkedList<String>();
13
13
14
	/**
15
	 * Adds a String with file contents to the Queue
16
	 * 
17
	 * @param input
18
	 *            String with contents of file
19
	 */
14
	public void addToQueue(String input) {
20
	public void addToQueue(String input) {
15
		System.out.println("[" + this.getqName() + "] Item was added");
21
		System.out.println("[" + this.getqName() + "] Item was added");
16
		this.queue.add(input);
22
		this.queue.add(input);
...
...
36
		return this.queue.size();
42
		return this.queue.size();
37
	}
43
	}
38
44
45
	/**
46
	 * Removes latest item from the Queue and removes it from the Queue.
47
	 * 
48
	 * @return File contents
49
	 */
39
	public String pollFromQueue() {
50
	public String pollFromQueue() {
40
		System.out.println("[" + this.getqName() + "] Item was polled");
51
		System.out.println("[" + this.getqName() + "] Item was polled");
41
		return this.queue.poll();
52
		return this.queue.poll();