repast.simphony.data2
Class BatchRunDataSource

java.lang.Object
  extended by repast.simphony.data2.BatchRunDataSource
All Implemented Interfaces:
AggregateDataSource, DataSource, NonAggregateDataSource

public class BatchRunDataSource
extends Object
implements AggregateDataSource, NonAggregateDataSource

DataSource that returns the current batch run number.

Author:
Nick Collier

Field Summary
static String ID
           
 
Constructor Summary
BatchRunDataSource()
           
 
Method Summary
 Object get(Iterable<?> objs, int size)
          Gets the data using the specified iterable.
 Object get(Object obj)
          Gets data given the specified object.
 Class<Integer> getDataType()
          Gets the type of data produced by this DataSource.
 String getId()
          Gets the unique id of this DataSource.
 Class<?> getSourceType()
          Gets the type of the object that this DataSource can retreive data from.
 void reset()
          Resets this AggregateDataSource prior to the next get call.
 void resetBatchRun(int batchRun)
          Resets the batch run number to the specified batch run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values
Constructor Detail

BatchRunDataSource

public BatchRunDataSource()
Method Detail

resetBatchRun

public void resetBatchRun(int batchRun)
Resets the batch run number to the specified batch run.

Parameters:
batchRun -

getId

public String getId()
Description copied from interface: DataSource
Gets the unique id of this DataSource. The id should be unique across the DataSet that this source is added to.

Specified by:
getId in interface DataSource
Returns:
the unique id of this DataSource.

getDataType

public Class<Integer> getDataType()
Description copied from interface: DataSource
Gets the type of data produced by this DataSource.

Specified by:
getDataType in interface DataSource
Returns:
the type of data produced by this DataSource.

get

public Object get(Object obj)
Description copied from interface: NonAggregateDataSource
Gets data given the specified object.

Specified by:
get in interface NonAggregateDataSource
Parameters:
obj - an object to get the data from
Returns:
the retrieved data.

get

public Object get(Iterable<?> objs,
                  int size)
Description copied from interface: AggregateDataSource
Gets the data using the specified iterable.

Specified by:
get in interface AggregateDataSource
Parameters:
objs - the iterable over objects to use in getting the data
size - the number of objects in the iterable
Returns:
the data using the specified iterable.

getSourceType

public Class<?> getSourceType()
Description copied from interface: DataSource
Gets the type of the object that this DataSource can retreive data from.

Specified by:
getSourceType in interface DataSource
Returns:
the type of the object that this DataSource can retreive data from.

reset

public void reset()
Description copied from interface: AggregateDataSource
Resets this AggregateDataSource prior to the next get call.

Specified by:
reset in interface AggregateDataSource