package cc.monitors;

import java.net.DatagramPacket;

public class Event {
	private long timestamp = 0;
	private long timestampDiff = 0;
	private int label = 0;
	private int size = 0;
	private int delay = 0;
	
	 public Event(Object obj){
			DatagramPacket p = (DatagramPacket) obj;
			timestamp = System.currentTimeMillis();
		
			java.util.StringTokenizer st = new java.util.StringTokenizer( new String(p.getData()), ";");
		
			label = (new Integer(st.nextToken())).intValue();
			timestampDiff = timestamp - (new Long(st.nextToken())).longValue();
			size = (new Integer(st.nextToken())).intValue();
			delay = (new Integer(st.nextToken())).intValue();
	}

	/**
	 * @return
	 */
	public int getDelay() {
		return delay;
	}

	/**
	 * @return
	 */
	public int getLabel() {
		return label;
	}

	/**
	 * @return
	 */
	public int getSize() {
		return size;
	}

	/**
	 * @return
	 */
	public long getTimestamp() {
		return timestamp;
	}

	/**
	 * @return
	 */
	public long getTimestampDiff() {
		return timestampDiff;
	}

}
