|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.analysis.AverageDataSource
public class AverageDataSource
Dynamically computes the average of a list of values. The values are are the result of calling a specified method on a specified list. For example, given a list of agents all of whom have an age value, the average age can be calculated by calling a method such as getAge() on each of the agents and averaging the this list of age values.
| Constructor Summary | |
|---|---|
AverageDataSource(java.lang.String name,
java.util.ArrayList list,
java.lang.String methodName)
Constructs this AverageDataSource using the specified list and method name. |
|
| Method Summary | |
|---|---|
java.lang.Object |
execute()
Computes the average. |
java.lang.String |
getName()
Gets the name of this datasource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AverageDataSource(java.lang.String name,
java.util.ArrayList list,
java.lang.String methodName)
list - the list of objects on which to call the methodmethodName - the name of the method to call. This method must return
some subclass of java.Number.Number| Method Detail |
|---|
public java.lang.Object execute()
execute in interface DataSourceDoublepublic java.lang.String getName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||