Class Counter

java.lang.Object
org.djutils.stats.summarizers.Counter
All Implemented Interfaces:
Serializable, CounterInterface

public class Counter
extends Object
implements CounterInterface
The Counter class defines a statistics event counter.

Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://simulation.tudelft.nl/dsol/3.0/license.html.

Author:
Alexander Verbraeck, Peter Jacobs
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected long count
    count represents the value of the counter.
    protected String description
    description refers to the title of this counter.
    protected long n
    n represents the number of measurements.
  • Constructor Summary

    Constructors 
    Constructor Description
    Counter​(String description)
    Constructs a new Counter.
  • Method Summary

    Modifier and Type Method Description
    long getCount()
    Returns the current counter value.
    String getDescription()
    Returns the description of the counter.
    long getN()
    Returns the current number of observations.
    long ingest​(long value)
    Process one observed value.
    void initialize()
    Initializes the counter.
    String toString()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • count

      protected long count
      count represents the value of the counter.
    • n

      protected long n
      n represents the number of measurements.
    • description

      protected String description
      description refers to the title of this counter.
  • Constructor Details

    • Counter

      public Counter​(String description)
      Constructs a new Counter.
      Parameters:
      description - String; the description for this counter
  • Method Details