package hu.advancedweb.scott.runtime.event;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class EventStore {
	private static List<Event> EVENTS = new ArrayList<Event>();

	public static void clear() {
		EVENTS.clear();
	}
	
	public static List<Event> getEvents() {
		return Collections.unmodifiableList(EVENTS);
	}
	
	public static void track(Object value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, value.toString()));
	}

	public static void track(byte value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Byte.toString(value)));
	}

	public static void track(short value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Short.toString(value)));
	}

	public static void track(int value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Integer.toString(value)));
	}

	public static void track(long value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Long.toString(value)));
	}

	public static void track(float value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Float.toString(value)));
	}

	public static void track(double value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Double.toString(value)));
	}

	public static void track(boolean value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Boolean.toString(value)));
	}

	public static void track(char value, int lineNumber) {
		EVENTS.add(new Event(lineNumber, Character.toString(value)));
	}
}

@@ -66,16 +66,41 @@
 ayList;%0A
+import java.util.Arrays;%0A
 import j
@@ -121,16 +121,16 @@
 ctions;%0A
-
 import j
@@ -476,27 +476,881 @@
 er, 
-value.toString()));
+objectToString(value)));%0A%09%7D%0A%0A%09private static String objectToString(Object value) %7B%0A%09%09if (value instanceof Object%5B%5D) %7B%0A%09%09%09return Arrays.toString((Object%5B%5D)value);%0A%09%09%7D else if (value instanceof boolean%5B%5D) %7B%0A%09%09%09return Arrays.toString((boolean%5B%5D)value);%0A%09%09%7D else if (value instanceof byte%5B%5D) %7B%0A%09%09%09return Arrays.toString((byte%5B%5D)value);%0A%09%09%7D else if (value instanceof short%5B%5D) %7B%0A%09%09%09return Arrays.toString((short%5B%5D)value);%0A%09%09%7D else if (value instanceof char%5B%5D) %7B%0A%09%09%09return Arrays.toString((char%5B%5D)value);%0A%09%09%7D else if (value instanceof int%5B%5D) %7B%0A%09%09%09return Arrays.toString((int%5B%5D)value);%0A%09%09%7D else if (value instanceof long%5B%5D) %7B%0A%09%09%09return Arrays.toString((long%5B%5D)value);%0A%09%09%7D else if (value instanceof float%5B%5D) %7B%0A%09%09%09return Arrays.toString((float%5B%5D)value);%0A%09%09%7D else if (value instanceof double%5B%5D) %7B%0A%09%09%09return Arrays.toString((double%5B%5D)value);%0A%09%09%7D else %7B%0A%09%09%09return value.toString();%0A%09%09%7D%09
 %0A%09%7D%0A

Add smart array rendering.