KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > fenyo > gnetwatch > data > EventGeneric


1
2 /*
3  * GNetWatch
4  * Copyright 2006, 2007 Alexandre Fenyo
5  * gnetwatch@fenyo.net
6  *
7  * This file is part of GNetWatch.
8  *
9  * GNetWatch is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * GNetWatch is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GNetWatch; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */

23
24 package net.fenyo.gnetwatch.data;
25
26 import net.fenyo.gnetwatch.*;
27 import net.fenyo.gnetwatch.targets.*;
28
29 import java.util.*;
30
31 import org.apache.commons.logging.Log;
32 import org.apache.commons.logging.LogFactory;
33
34 /**
35  * This base class for every events stores the date of the event.
36  * @author Alexandre Fenyo
37  * @version $Id: EventGeneric.java,v 1.9 2007/03/09 22:44:20 fenyo Exp $
38  */

39
40 public abstract class EventGeneric {
41   private static Log log = LogFactory.getLog(EventGeneric.class);
42
43   private final Date date;
44
45   /**
46    * Constructor.
47    * @param date date of creation.
48    */

49   protected EventGeneric(final Date date) {
50     this.date = date;
51   }
52
53   /**
54    * Constructor.
55    * @param none.
56    */

57   // Queue thread
58
public EventGeneric() {
59     this.date = new Date(System.currentTimeMillis());
60   }
61
62   /**
63    * Returns an integer representation of the performance counter associated whith this event.
64    * @param events every event.
65    * @param idx index of this event.
66    * @return int performance counter.
67    */

68   public int getIntValue(final java.util.List JavaDoc<EventGeneric> events, final int idx) {
69     return -1;
70   }
71
72   /**
73    * Returns the date of creation of this event.
74    * @param none.
75    * @return Date date of creation.
76    */

77   // AWT & Queue thread
78
public Date getDate() {
79     return date;
80   }
81 }
82
Popular Tags