Code example for LinkedList

Methods: add, size, toArray

0
	public AuAppendChild(Page page, Collection<String> contents) {
		super("addChd", page, toArray(page.getUuid(), contents));
	} 
	/** Converts the contents (a collection of strings) to an array of JavaScriptValue. */ 
	/*package*/ static Object[] toArray(String uuid, Collection<String> contents) {
		final List<Object> list = new LinkedList<Object>();
		list.add(uuid);
		stringToJS(contents, list);
		return list.toArray(new Object[list.size()]);
	} 
	/** Converts the contents (a collection of strings) to an array of JavaScriptValue. */ 
	private static void stringToJS(Collection<String> contents, Collection<Object> result) {
		for (String content: contents)
			result.add(new JavaScriptValue(content));
	} 
}