avrora.util.profiling
Class Measurements

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

public class Measurements
extends java.lang.Object

The Measurements 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 Measurements.Iterator
           
 
Constructor Summary
Measurements()
          The default constructor for the Measurements class creates a new instance where the fragment size is 500.
Measurements(int fragsize)
          This constructor for the Measurements class creates a new instance with the specified fragment size.
 
Method Summary
 void add(int nm)
          The add() method adds a new measurement to this set.
 void addAll(Measurements m)
          The addAll() method adds all of the measurements from another measurement structure to the end of this measurement structure.
 Measurements.Iterator iterator(int start)
          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

Measurements

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


Measurements

public Measurements(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(int nm)
The add() method adds a new measurement to this set.

Parameters:
nm - the new measurement to add

iterator

public Measurements.Iterator iterator(int start)
The iterator() method returns an interator over the measurements, starting with the specified measurement.

Parameters:
start - the index of the first measurement to start from
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(Measurements 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

min

public int min()

max

public int max()