1 package org.opentrafficsim.road.network.factory.osm.events;
2
3 import java.util.EventObject;
4
5
6
7
8
9
10
11
12
13
14 public class ProgressEvent extends EventObject
15 {
16
17 private static final long serialVersionUID = 1L;
18
19
20 private static Long first = null;
21
22
23 private final String progressInformation;
24
25
26 private final long when;
27
28
29
30
31
32
33 public ProgressEvent(final Object source, final String description)
34 {
35 super(source);
36 this.progressInformation = description;
37 this.when = System.currentTimeMillis();
38 if (null == first)
39 {
40 first = this.when;
41 }
42 }
43
44
45
46
47 public final String getProgress()
48 {
49 return String.format("%8d ", (this.when - first) % 100000000L) + this.progressInformation;
50 }
51
52
53 @Override
54 public final String toString()
55 {
56 return "ProgressEvent [progressInformation=" + this.progressInformation + ", when=" + this.when + "]";
57 }
58 }