Code example for LinkedList

Methods: addLast, removeFirst, size

0
		LogEntry e = new LogEntry();
		e.timestamp = new Date();
		e.level = level;
		e.msg = msg;
 
		if (circ.size() >= MAX_ENTRIES) {
			circ.removeFirst();
		} 
		circ.addLast(e);
	} 
 
	public static synchronized String getLog() {
		StringBuilder ret = new StringBuilder();
 
		for (int i = 0; i < circ.size(); i++) {
			LogEntry e = circ.get(i);
			String timestamp = new SimpleDateFormat("HH:mm:ss").format(e.timestamp);
			ret.append(timestamp + " " + e.msg + "\n");
		} 
 
		return ret.toString();