uchicago.src.sim.analysis
Class ObjectDataSource

java.lang.Object
  extended by uchicago.src.sim.analysis.ObjectDataSource
All Implemented Interfaces:
DataSource

public class ObjectDataSource
extends java.lang.Object
implements DataSource

A data source that returns objects. ObjectDataSource is used by DataRecorder and should not be created by users under normal circumstances.

Version:
$Revision: 1.4 $ $Date: 2004/11/03 19:51:00 $
Author:
Nick Collier
See Also:
DataRecorder

Constructor Summary
ObjectDataSource(java.lang.String name, java.lang.Object o, java.lang.reflect.Method m)
          Constructs an ObjectDataSource using the specified name, Object and method.
ObjectDataSource(java.lang.String name, java.lang.Object o, java.lang.String methodName)
          Constructs this ObjectDataSource using the specified object and method name.
 
Method Summary
 java.lang.Object execute()
          Call the method on the object and return the resulting data as an object
 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

ObjectDataSource

public ObjectDataSource(java.lang.String name,
                        java.lang.Object o,
                        java.lang.String methodName)
Constructs this ObjectDataSource using the specified object and method name. The method whose method name is specified by methodName is called on the object in ObjectDataSource.execute(). The result is the data returned by this DataSource.

Parameters:
name - the name of this DataSource
o - the object on which to call the method
methodName - the name of the method to call on the object. This method must return an Object.

ObjectDataSource

public ObjectDataSource(java.lang.String name,
                        java.lang.Object o,
                        java.lang.reflect.Method m)
Constructs an ObjectDataSource using the specified name, Object and method.

Parameters:
name - the name of this DataSource
o - the object on which to call the method that returns the data
m - the method to call on the object. This method returns the data
Method Detail

execute

public java.lang.Object execute()
Call the method on the object and return the resulting data as an object

Specified by:
execute in interface DataSource

getName

public java.lang.String getName()
Gets the name of this datasource