org.powertac.common.repo
Class TariffRepo

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

@Repository
public class TariffRepo
extends Object
implements DomainRepo

Repository for TariffSpecifications, Tariffs, Rates, and other related types.

Author:
John Collins

Constructor Summary
TariffRepo()
           
 
Method Summary
 void addBalancingOrder(BalancingOrder order)
          Adds a balancing order, indexed by its TariffSpec
 void addSpecification(TariffSpecification spec)
          Adds a TariffSpecification to the repo just in case another spec (or this one) has not already been added sometime in the past.
 void addTariff(Tariff tariff)
           
 List<Tariff> findActiveTariffs(PowerType type)
          Returns the list of active tariffs that exactly match the given PowerType.
 List<Tariff> findAllActiveTariffs(PowerType type)
          Returns the list of active tariffs that can be used by a customer of the given PowerType, including those that are more generic than the specific type.
 List<Tariff> findAllTariffs()
           
 List<TariffSpecification> findAllTariffSpecifications()
           
 Rate findRateById(long id)
           
 TariffSpecification findSpecificationById(long id)
           
 Tariff findTariffById(long id)
           
 List<Tariff> findTariffsByState(Tariff.State state)
           
 Collection<BalancingOrder> getBalancingOrders()
          Retrieves the complete set of balancing orders
 boolean isRemoved(long tariffId)
          Tests whether a tariff has been deleted.
 void recycle()
          Implementations must clear out the repository in preparation for a new simulation.
 void removeTariff(Tariff tariff)
          Removes a tariff and its specification from the repo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TariffRepo

public TariffRepo()
Method Detail

addSpecification

public void addSpecification(TariffSpecification spec)
Adds a TariffSpecification to the repo just in case another spec (or this one) has not already been added sometime in the past.


findSpecificationById

public TariffSpecification findSpecificationById(long id)

findAllTariffSpecifications

public List<TariffSpecification> findAllTariffSpecifications()

addTariff

public void addTariff(Tariff tariff)

findTariffById

public Tariff findTariffById(long id)

findAllTariffs

public List<Tariff> findAllTariffs()

findTariffsByState

public List<Tariff> findTariffsByState(Tariff.State state)

findActiveTariffs

public List<Tariff> findActiveTariffs(PowerType type)
Returns the list of active tariffs that exactly match the given PowerType.


findAllActiveTariffs

public List<Tariff> findAllActiveTariffs(PowerType type)
Returns the list of active tariffs that can be used by a customer of the given PowerType, including those that are more generic than the specific type.


removeTariff

public void removeTariff(Tariff tariff)
Removes a tariff and its specification from the repo


isRemoved

public boolean isRemoved(long tariffId)
Tests whether a tariff has been deleted.


findRateById

public Rate findRateById(long id)

addBalancingOrder

public void addBalancingOrder(BalancingOrder order)
Adds a balancing order, indexed by its TariffSpec


getBalancingOrders

public Collection<BalancingOrder> getBalancingOrders()
Retrieves the complete set of balancing orders


recycle

public void recycle()
Description copied from interface: DomainRepo
Implementations must clear out the repository in preparation for a new simulation.

Specified by:
recycle in interface DomainRepo


Copyright © 2012. All Rights Reserved.