View Javadoc
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-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>.
11   * </p>
12   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   */
15  public interface TimestampTallyInterface extends WeightedTallyInterface
16  {
17      /**
18       * Return whether the statistic is active (accepting observations) or not.
19       * @return boolean; whether the statistic is active (accepting observations) or not
20       */
21      boolean isActive();
22  
23      /**
24       * End the observations and closes the last interval of observations. After ending, no more observations will be accepted.
25       * Calling this method will create an extra observation, and corresponding events for the EventBased implementations of this
26       * interface will be called.
27       * @param timestamp Number; the Number object representing the final timestamp
28       */
29      void endObservations(Number timestamp);
30  
31      /**
32       * End the observations and closes the last interval of observations. After ending, no more observations will be accepted.
33       * Calling this method will create an extra observation, and corresponding events for the EventBased implementations of this
34       * interface will be called.
35       * @param timestamp Calendar; the Calendar object representing the final timestamp
36       */
37      void endObservations(Calendar timestamp);
38  
39  }