JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
ConsoleProgressReporter.java
Go to the documentation of this file.
1 package jarmos.util;
2 
9 public class ConsoleProgressReporter implements IProgressReporter {
10 
11  private int total = -1;
12  private String msg = "ConsoleProgressReporter";
13 
14  /*
15  * (non-Javadoc)
16  *
17  * @see jarmos.util.IProgressReporter#setMessage(java.lang.String)
18  */
19  @Override
20  public void setMessage(String msg) {
21  this.msg = msg;
22  }
23 
24  /*
25  * (non-Javadoc)
26  *
27  * @see jarmos.util.IProgressReporter#progress(int)
28  */
29  @Override
30  public void progress(int value) {
31  System.out.println(msg + ": " + value + "/" + total);
32  }
33 
34  /*
35  * (non-Javadoc)
36  *
37  * @see jarmos.util.IProgressReporter#init(int)
38  */
39  @Override
40  public void init(String title, int total) {
41  System.out.println("New console progress: " + title);
42  this.total = total;
43  }
44 
45  /*
46  * (non-Javadoc)
47  *
48  * @see jarmos.util.IProgressReporter#finish()
49  */
50  @Override
51  public void finish() {
52  total = 0;
53  msg = "";
54  }
55 
56 }
Simple progress reporting implementation using the Java standard console.
Simple interface for progress reporting.