org.powertac.common.repo
Class OrderbookRepo

java.lang.Object
  extended by org.powertac.common.repo.OrderbookRepo
All Implemented Interfaces:
DomainRepo

@Repository
public class OrderbookRepo
extends Object
implements DomainRepo

Repository for Orderbooks. Orderbooks are created with makeOrderbook(). Query methods include findByTimeslot().

Author:
John Collins

Constructor Summary
OrderbookRepo()
          Standard constructor
 
Method Summary
 List<Orderbook> findAllByTimeslot(Timeslot timeslot)
           
 Orderbook findByTimeslot(Timeslot timeslot)
          Returns the most recent Orderbook that has been created for the specified timeslot.
 Orderbook findSpotByTimeslot(Timeslot timeslot)
          Returns the most recent orderbook with a non-null clearing price.
 Orderbook makeOrderbook(Timeslot timeslot, Double clearingPrice)
          Creates a new Orderbook, with standard defaults (productType = Future, dateExecuted = now).
 void recycle()
          Clears the index in preparation for a new simulation
 int size()
          Returns the count of instances in this repo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderbookRepo

public OrderbookRepo()
Standard constructor

Method Detail

makeOrderbook

public Orderbook makeOrderbook(Timeslot timeslot,
                               Double clearingPrice)
Creates a new Orderbook, with standard defaults (productType = Future, dateExecuted = now).


findByTimeslot

public Orderbook findByTimeslot(Timeslot timeslot)
Returns the most recent Orderbook that has been created for the specified timeslot.


findSpotByTimeslot

public Orderbook findSpotByTimeslot(Timeslot timeslot)
Returns the most recent orderbook with a non-null clearing price. Note that this can return null if this timeslot has never cleared.


findAllByTimeslot

public List<Orderbook> findAllByTimeslot(Timeslot timeslot)

size

public int size()
Returns the count of instances in this repo


recycle

public void recycle()
Clears the index in preparation for a new simulation

Specified by:
recycle in interface DomainRepo


Copyright © 2011. All Rights Reserved.