Java Code Examples for org.apache.commons.collections.Buffer#clear()

The following examples show how to use org.apache.commons.collections.Buffer#clear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NotifyServlet.java    From juddi with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request,
		HttpServletResponse response) throws
	ServletException, IOException {
	StringBuffer sb = new StringBuffer();

	Buffer nl = NotificationList.getInstance().getNotifications();
	Iterator<String> it = nl.iterator();
	while (it.hasNext()) {
		String notification = (String) it.next();		
		sb.append(notification);
	}
	nl.clear();
	PrintWriter out = response.getWriter();
	out.println(sb.toString());
}
 
Example 2
Source File: NotifyServlet.java    From juddi with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request,
		HttpServletResponse response) throws
	ServletException, IOException {
	StringBuffer sb = new StringBuffer();

	Buffer nl = NotificationList.getInstance().getNotifications();
	Iterator<String> it = nl.iterator();
	while (it.hasNext()) {
		String notification = (String) it.next();		
		sb.append(notification);
	}
	nl.clear();
	PrintWriter out = response.getWriter();
	out.println(sb.toString());
}