Package org.powertac.common.repo
Class WeatherReportRepo
- java.lang.Object
- 
- org.powertac.common.repo.WeatherReportRepo
 
- 
- All Implemented Interfaces:
- DomainRepo
 
 @Service public class WeatherReportRepo extends Object implements DomainRepo Repository for WeatherReports. The weather reports are indexed by the timeslot that they are issued for. This allows them to be quickly accessed via a hashMap. The parameter maxReportCount controls the number of weather reports kept in memory.- Author:
- Erik Onarheim
 
- 
- 
Constructor SummaryConstructors Constructor Description WeatherReportRepo()standard constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(WeatherReport weather)Adds a WeatherReport to the repo, keeping only maxReportCount aroundList<WeatherReport>allWeatherReports()Returns a list of all the issued weather reports up to the currentTimeslotintcount()Returns the number of weatherReports that have been successfully added.WeatherReportcurrentWeatherReport()Returns the current weatherReportvoidrecycle()Implementations must clear out the repository in preparation for a new simulation.voidrunOnce()Called by weather service to indicate weather exists
 
- 
- 
- 
Method Detail- 
addpublic void add(WeatherReport weather) Adds a WeatherReport to the repo, keeping only maxReportCount around
 - 
currentWeatherReportpublic WeatherReport currentWeatherReport() throws PowerTacException Returns the current weatherReport- Throws:
- PowerTacException
 
 - 
allWeatherReportspublic List<WeatherReport> allWeatherReports() Returns a list of all the issued weather reports up to the currentTimeslot
 - 
countpublic int count() Returns the number of weatherReports that have been successfully added.
 - 
runOncepublic void runOnce() Called by weather service to indicate weather exists
 - 
recyclepublic void recycle() Description copied from interface:DomainRepoImplementations must clear out the repository in preparation for a new simulation.- Specified by:
- recyclein interface- DomainRepo
 
 
- 
 
-