org.powertac.visualizer.services
Class CustomerService

java.lang.Object
  extended by org.powertac.visualizer.services.CustomerService
All Implemented Interfaces:
Recyclable, TimeslotCompleteActivation

@Service
public class CustomerService
extends Object
implements TimeslotCompleteActivation, Recyclable

Contains data about the customers.

Author:
Jurica Babic

Constructor Summary
CustomerService()
           
 
Method Summary
 void activate(int timeslotIndex, org.joda.time.Instant postedTime)
           
 void addCustomers(List<org.powertac.common.CustomerInfo> customerInfos)
          Creates and adds a customer object into the map.
 Customer findCustomerByCustomerInfo(org.powertac.common.CustomerInfo customerInfo)
           
 Customer findCustomerByNameAndType(String customerName, org.powertac.common.enumerations.PowerType type)
           
 ArrayList<Customer> getConsumers()
           
 List<Customer> getCustomerList()
           
 ArrayList<Customer> getProducers()
           
 ArrayList<Customer> getStorages()
           
 void recycle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerService

public CustomerService()
Method Detail

addCustomers

public void addCustomers(List<org.powertac.common.CustomerInfo> customerInfos)
Creates and adds a customer object into the map. Map key will be a given customerInfo.


findCustomerByNameAndType

public Customer findCustomerByNameAndType(String customerName,
                                          org.powertac.common.enumerations.PowerType type)
Parameters:
customerName -
Returns:
Customer associated by the given name, or null if the customer cannot be found.

recycle

public void recycle()
Specified by:
recycle in interface Recyclable

getCustomerList

public List<Customer> getCustomerList()

activate

public void activate(int timeslotIndex,
                     org.joda.time.Instant postedTime)
Specified by:
activate in interface TimeslotCompleteActivation
Parameters:
timeslotIndex - index of completed timeslot.

findCustomerByCustomerInfo

public Customer findCustomerByCustomerInfo(org.powertac.common.CustomerInfo customerInfo)

getConsumers

public ArrayList<Customer> getConsumers()

getProducers

public ArrayList<Customer> getProducers()

getStorages

public ArrayList<Customer> getStorages()


Copyright © 2012 Power TAC. All Rights Reserved.