1 package net.sourceforge.basher.events;
2
3 import java.util.EventObject;
4
5
6
7
8
9 public abstract class BasherEvent extends EventObject
10 {
11 private long _creationTime;
12
13 public BasherEvent()
14 {
15 super("<none>");
16 _creationTime = System.currentTimeMillis();
17 }
18
19
20
21
22
23 public long getCreationTime()
24 {
25 return _creationTime;
26 }
27
28
29
30
31
32 void setCreationTime( final long creationTime )
33 {
34 _creationTime = creationTime;
35 }
36
37
38
39
40
41
42
43 public BasherEvent(Object source)
44 {
45 super(source);
46 _creationTime = System.currentTimeMillis();
47 }
48
49
50
51 @Override
52 public String toString()
53 {
54 return "BasherEvent{" +
55 "_creationTime=" + _creationTime +
56 '}';
57 }
58
59 @Override
60 public boolean equals( final Object o )
61 {
62 if ( this == o )
63 {
64 return true;
65 }
66 if ( o == null || getClass() != o.getClass() )
67 {
68 return false;
69 }
70
71 final BasherEvent that = ( BasherEvent ) o;
72
73 if ( _creationTime != that._creationTime )
74 {
75 return false;
76 }
77
78 return true;
79 }
80
81 @Override
82 public int hashCode()
83 {
84 return ( int ) ( _creationTime ^ ( _creationTime >>> 32 ) );
85 }
86 }