/*
* GNetWatch
* Copyright 2006, 2007 Alexandre Fenyo
* gnetwatch@fenyo.net
*
* This file is part of GNetWatch.
*
* GNetWatch is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GNetWatch is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNetWatch; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.fenyo.gnetwatch.data;
import net.fenyo.gnetwatch.*;
import net.fenyo.gnetwatch.targets.*;
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* This base class for every events stores the date of the event.
* @author Alexandre Fenyo
* @version $Id: EventGeneric.java,v 1.9 2007/03/09 22:44:20 fenyo Exp $
*/
public abstract class EventGeneric {
private static Log log = LogFactory.getLog(EventGeneric.class);
private final Date date;
/**
* Constructor.
* @param date date of creation.
*/
protected EventGeneric(final Date date) {
this.date = date;
}
/**
* Constructor.
* @param none.
*/
// Queue thread
public EventGeneric() {
this.date = new Date(System.currentTimeMillis());
}
/**
* Returns an integer representation of the performance counter associated whith this event.
* @param events every event.
* @param idx index of this event.
* @return int performance counter.
*/
public int getIntValue(final java.util.List<EventGeneric> events, final int idx) {
return -1;
}
/**
* Returns the date of creation of this event.
* @param none.
* @return Date date of creation.
*/
// AWT & Queue thread
public Date getDate() {
return date;
}
}
|