/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package etomica.data;

import etomica.integrator.IntegratorMD;
import etomica.units.dimensions.Time;

/**
 * Data source that keeps track of the elapsed simulation time of an MD
 * integrator. More precisely, sums the integrator's interval value times the
 * time-step each time the integrator fires an INTERVAL event. A START event
 * from the integrator will reset the elapsedTime.
 */
public class DataSourceCountTime extends DataSourceScalar {

    /**
	 * Sets up data source with no integrator specified.  Requires
	 * call to addIntegrator or setIntegrator before use.
	 */
	public DataSourceCountTime() {
		super("Simulation Time", Time.DIMENSION);
	}
    
    public DataSourceCountTime(IntegratorMD integrator) {
        this();
        setIntegrator(integrator);
    }

    public void setIntegrator(IntegratorMD newIntegrator) {
        integrator = newIntegrator;
    }
    
	/**
	 * Returns the simulation time elapsed by the integrator tracked
	 * by this class since the last reset. 
	 */
	public double getDataAsScalar() {
        return integrator.getCurrentTime();
	}
    
    private static final long serialVersionUID = 2L;
    protected IntegratorMD integrator;
}

@@ -329,22 +329,15 @@
 hat 
-keeps track of
+returns
  the
@@ -369,19 +369,16 @@
 of an MD
-%0A *
  integra
@@ -385,199 +385,8 @@
 tor.
- More precisely, sums the integrator's interval value times the%0A * time-step each time the integrator fires an INTERVAL event. A START event%0A * from the integrator will reset the elapsedTime.
 %0A */
@@ -451,95 +451,36 @@
  %7B%0A%0A
-    /**%0A%09 * Sets up data s
+%09public DataS
 ource
- with no integrator specified.  Requires%0A%09 * call to add
+CountTime(
 Inte
@@ -489,16 +489,12 @@
 ator
- or setI
+MD i
 nteg
@@ -502,54 +502,8 @@
 ator
- before use.%0A%09 */%0A%09public DataSourceCountTime(
 ) %7B%0A
@@ -551,216 +551,28 @@
 );%0A%09
-%7D%0A    %0A    public DataSourceCountTime(IntegratorMD integrator) %7B%0A        this();%0A        setIntegrator(integrator);%0A    %7D%0A%0A    public void setIntegrator(IntegratorMD newIntegrator) %7B%0A        integrator = newI
+%09this.integrator = i
 nteg
@@ -582,18 +582,11 @@
 or;%0A
-    %7D%0A    
+%09%7D%0A
 %0A%09/*
@@ -692,17 +692,16 @@
 t reset.
- 
 %0A%09 */%0A%09p
@@ -737,16 +737,10 @@
 ) %7B%0A
-        
+%09%09
 retu
@@ -778,79 +778,25 @@
 %0A%09%7D%0A
-    %0A    private static final long serialVersionUID = 2L;%0A    protected
+%0A%09protected final
  Int

Simplify DataSourceCountTime and fix comments