avrora.util.profiling
Class TimedMeasurements

java.lang.Object
  extended byavrora.util.profiling.TimedMeasurements

public class TimedMeasurements
extends java.lang.Object

The TimedMeasurements class implements a simple array-like data structure that collects a large list of integers and supports iterating over that list. For memory-efficient storage, it uses a set of arrays where each array represents a fragment of the measurements obtained.


Nested Class Summary
 class TimedMeasurements.Iterator
           
static class TimedMeasurements.Measurement
           
 
Constructor Summary
TimedMeasurements()
          The default constructor for the Measurements class creates a new instance where the fragment size is 500.
TimedMeasurements(int fragsize)
          This constructor for the Measurements class creates a new instance with the specified fragment size.
 
Method Summary
 void add(long time, int nm)
          The add() method adds a new measurement to this set.
 void addAll(TimedMeasurements m)
          The addAll() method adds all of the measurements from another measurement structure to the end of this measurement structure.
 long getLastTime()
          The getLastTime() method returns the time when the last measurement was recorded.
 TimedMeasurements.Iterator iterator(long startTime)
          The iterator() method returns an interator over the measurements, starting with the specified measurement.
 int max()
           
 int min()
           
 int size()
          The size() method returns the number of entries in this measurement data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedMeasurements

public TimedMeasurements()
The default constructor for the Measurements class creates a new instance where the fragment size is 500.


TimedMeasurements

public TimedMeasurements(int fragsize)
This constructor for the Measurements class creates a new instance with the specified fragment size.

Parameters:
fragsize - the fragment size to use for internal representation
Method Detail

add

public void add(long time,
                int nm)
The add() method adds a new measurement to this set.

Parameters:
time - the time of the measurement
nm - the new measurement to add

iterator

public TimedMeasurements.Iterator iterator(long startTime)
The iterator() method returns an interator over the measurements, starting with the specified measurement.

Parameters:
startTime - the time to start
Returns:
an iterator that will start at the specified measurement and continue until the end

size

public int size()
The size() method returns the number of entries in this measurement data.

Returns:
the number of measurements

addAll

public void addAll(TimedMeasurements m)
The addAll() method adds all of the measurements from another measurement structure to the end of this measurement structure.

Parameters:
m - the measurements to add to the end of this list

getLastTime

public long getLastTime()
The getLastTime() method returns the time when the last measurement was recorded.

Returns:
the time in clock cycles that the last measurement was recorded

min

public int min()

max

public int max()