1 package org.djutils.stats.summarizers;
2
3 import java.util.Calendar;
4
5 /**
6 * The TimestampedTally interface defines the methods that a timestamped tally should implement in addition to the standard
7 * weighted tally. Timestamps can, e.g., be Number based or Calendar based.
8 * <p>
9 * Copyright (c) 2020-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10 * BSD-style license. See <a href="https://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>. <br>
11 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
12 * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
13 */
14 public interface TimestampTallyInterface extends WeightedTallyInterface
15 {
16 /**
17 * Return whether the statistic is active (accepting observations) or not.
18 * @return boolean; whether the statistic is active (accepting observations) or not
19 */
20 boolean isActive();
21
22 /**
23 * End the observations and closes the last interval of observations. After ending, no more observations will be accepted.
24 * Calling this method will create an extra observation, and corresponding events for the EventBased implementations of this
25 * interface will be called.
26 * @param timestamp Number; the Number object representing the final timestamp
27 */
28 void endObservations(Number timestamp);
29
30 /**
31 * End the observations and closes the last interval of observations. After ending, no more observations will be accepted.
32 * Calling this method will create an extra observation, and corresponding events for the EventBased implementations of this
33 * interface will be called.
34 * @param timestamp Calendar; the Calendar object representing the final timestamp
35 */
36 void endObservations(Calendar timestamp);
37
38 }