nl.tudelft.simulation.jstats.statistics
Class Counter

java.lang.Object
  extended by nl.tudelft.simulation.event.EventProducer
      extended by nl.tudelft.simulation.jstats.statistics.StatisticsObject
          extended by nl.tudelft.simulation.jstats.statistics.Counter
All Implemented Interfaces:
Serializable, EventListener, EventListenerInterface, EventProducerInterface, Swingable

public class Counter
extends StatisticsObject
implements EventListenerInterface

The Counter class defines a statistics event counter.

(c) copyright 2002-2005-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:43 $
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
protected  long count
          count represents the value of the counter
static EventType COUNT_EVENT
          COUNT_EVENT is fired whenever setCount() is invoked
protected  String description
          description refers to the title of this counter
protected  long n
          n represents the number of measurements
static EventType N_EVENT
          N_EVENT is fired on every new measurement
 
Fields inherited from class nl.tudelft.simulation.jstats.statistics.StatisticsObject
filter
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
Counter(String description)
          constructs a new CounterTest
 
Method Summary
 long getCount()
          Returns the current counter value
 String getDescription()
          returns the description of the counter
 long getN()
          Returns the current number of observations
 TableModel getTable()
          represents the statistics object as Table.
 void initialize()
          initializes the counter
 boolean isInitialized()
          is the counter initialized?
 void notify(EventInterface event)
           
 String toString()
           
 
Methods inherited from class nl.tudelft.simulation.jstats.statistics.StatisticsObject
getSwingPanel
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COUNT_EVENT

public static final EventType COUNT_EVENT
COUNT_EVENT is fired whenever setCount() is invoked


N_EVENT

public static final EventType N_EVENT
N_EVENT is fired on every new measurement


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

Counter

public Counter(String description)
constructs a new CounterTest

Parameters:
description - 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

notify

public void notify(EventInterface event)
Specified by:
notify in interface EventListenerInterface
See Also:
#notify(nl.tudelft.simulation.event.EventInterface)

toString

public String toString()
Overrides:
toString in class Object
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

getTable

public TableModel getTable()
Description copied from class: StatisticsObject
represents the statistics object as Table.

Specified by:
getTable in class StatisticsObject
Returns:
TableModel the result
See Also:
#getTable()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.