1 package org.djutils.stats.summarizers;
2
3 import java.io.Serializable;
4
5 /**
6 * The Counter interface defines the methods to implement for a statistics event counter.
7 * <p>
8 * Copyright (c) 2002-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
9 * for project information <a href="https://simulation.tudelft.nl/" target="_blank"> https://simulation.tudelft.nl</a>. The DSOL
10 * project is distributed under a three-clause BSD-style license, which can be found at
11 * <a href="https://simulation.tudelft.nl/dsol/3.0/license.html" target="_blank">
12 * https://simulation.tudelft.nl/dsol/3.0/license.html</a>. <br>
13 * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank"> Alexander Verbraeck</a>
14 * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a>
15 */
16 public interface CounterInterface extends Serializable
17 {
18 /**
19 * Initializes the counter.
20 */
21 void initialize();
22
23 /**
24 * Process one observed value.
25 * @param value long; the value to process
26 * @return long; the value
27 */
28 long register(long value);
29
30 /**
31 * Returns the description of the counter.
32 * @return String; the description
33 */
34 String getDescription();
35
36 /**
37 * Returns the current counter value.
38 * @return long; the counter value
39 */
40 long getCount();
41
42 /**
43 * Returns the current number of observations.
44 * @return long; the number of observations
45 */
46 long getN();
47
48 }