Class XCounter
- java.lang.Object
-
- org.opentrafficsim.water.statistics.XCounter
-
- All Implemented Interfaces:
Serializable
public class XCounter extends Object implements Serializable
Copyright (c) 2011-2013 TU Delft, Faculty of TBM, Systems and Simulation
This software is licensed without restrictions to Nederlandse Organisatie voor Toegepast Natuurwetenschappelijk Onderzoek TNO (TNO), Erasmus University Rotterdam, Delft University of Technology, Panteia B.V., Stichting Projecten Binnenvaart, Ab Ovo Nederland B.V., Modality Software Solutions B.V., and Rijkswaterstaat - Dienst Water, Verkeer en Leefomgeving, including the right to sub-license sources and derived products to third parties.- Version:
- Apr 1, 2013
- Author:
- Alexander Verbraeck
- 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
count(long value)
long
getCount()
Returns the current counter value.String
getDescription()
returns the description of the counter.long
getN()
Returns the current number of observations.void
initialize()
initializes the counter.boolean
isInitialized()
is the counter initialized?String
toString()
int
writeToExcel(Sheet sheet, int startRow)
Write statistics to an excel spreadsheet, starting on row "startRow".
-
-
-
Field Detail
-
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 Detail
-
XCounter
public XCounter(String description)
constructs a new CounterTest.- Parameters:
description
- String; the description for this counter
-
-
Method Detail
-
getCount
public long getCount()
Returns the current counter value.- Returns:
- long the counter value
-
getN
public long getN()
Returns the current number of observations.- Returns:
- long the number of observations
-
count
public void count(long value)
- Parameters:
value
- long; the value
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
initialize
public void initialize()
initializes the counter.
-
isInitialized
public boolean isInitialized()
is the counter initialized?- Returns:
- returns whether the counter is initialized
-
getDescription
public String getDescription()
returns the description of the counter.- Returns:
- String the description
-
writeToExcel
public int writeToExcel(Sheet sheet, int startRow)
Write statistics to an excel spreadsheet, starting on row "startRow".- Parameters:
sheet
- Sheet; the sheetstartRow
- int; the first row- Returns:
- first free row after writing
-
-