Commit 7d1b89bd authored by afreyssin's avatar afreyssin
Browse files

Adds a new method allowing to output the list as a String (for save purpose for example).

parent 553c863a
/*
* Copyright (C) 2001 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2015 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
*
......@@ -188,4 +188,15 @@ public class Queue implements Serializable {
return elements.size();
}
/**
* Returns a stringified form of the queue.
*/
public synchronized String list() {
if (elements.isEmpty()) return "";
StringBuffer strbuf = new StringBuffer();
for (int i=0; i<elements.size(); i++)
strbuf.append(elements.get(i)).append(',');
return strbuf.toString();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment