RePast
v. 2.0

uchicago.src.sim.analysis
Class DataSourceUtilities

java.lang.Object
  |
  +--uchicago.src.sim.analysis.DataSourceUtilities

public class DataSourceUtilities
extends Object

Utility methods for return data. Used by those classes that realize the DataSource interface.


Constructor Summary
DataSourceUtilities()
           
 
Method Summary
static Object getAverage(ArrayList list, Method m)
          Calls the specified method on every object in the specified list.
static Object getObject(Object o, Method m)
          Calls the specified method on the specified object, returning the result as an Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceUtilities

public DataSourceUtilities()
Method Detail

getObject

public static Object getObject(Object o,
                               Method m)
Calls the specified method on the specified object, returning the result as an Object


getAverage

public static Object getAverage(ArrayList list,
                                Method m)
Calls the specified method on every object in the specified list. The resulting values are averaged and this average is returned as a Double. Average is computed as the (sum of the all the elements in the list) / (the size of the list).

Returns:
the average as a Double (to be cast by caller).

RePast
v. 2.0

Bug reports and feature requests to RePast