org.gscg.game
Class GameActorContentStore

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.supplychain.content.ContentStore
          extended bynl.tudelft.simulation.supplychain.content.LeanContentStore
              extended byorg.gscg.game.GameActorContentStore
All Implemented Interfaces:
nl.tudelft.simulation.event.EventProducerInterface, java.io.Serializable

public class GameActorContentStore
extends nl.tudelft.simulation.supplychain.content.LeanContentStore

The GameActorContentStore is taking care of storing content for display on the client screen. It acts as a kind of primitive database system. In this implementation, all the messages are linked to an InternalDemand, as this sets off the whole chain of messages, no matter whether it is a purchase, internal production, or stock replenishment: in all cases the InternalDemand triggers all the other messages.

The ContentStore has a HashMap called internalDemandMap that maps the internal demand's uniqueID onto the so-called contentClassMap. This map has the Content's class as key, and maps that onto an ArrayList called 'contentList', which contains all the contents sent or received in order of arrival or sending.

Messages that move to the following 'stage' are removed from the previous 'stage'. The class fires an event for each change that occurs. There is a standard ContentNumberData class to indicate the new number.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Since:
1.0.0
Version:
$Revision: 1.3 $ $Date: 2005/08/10 11:23:30 $
Author:
Alexander Verbraeck
See Also:
Serialized Form

Field Summary
static nl.tudelft.simulation.event.EventType EVENT_ORDERCOMMIT_RECEIVED
          the event for the order confirmation received
static nl.tudelft.simulation.event.EventType EVENT_ORDERCOMMIT_SENT
          the event for the order confirmation sent
static nl.tudelft.simulation.event.EventType UPDATE_ALL_NUMBER_DATA_EVENT
          the UPDATE_ALL_NUMBER_DATA_EVENT event
 
Fields inherited from class nl.tudelft.simulation.supplychain.content.LeanContentStore
simulator
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
GameActorContentStore(nl.tudelft.simulation.supplychain.actor.SupplyChainActor owner, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator)
          Constructs a new GameActorContentStore
 
Method Summary
 void addContent(nl.tudelft.simulation.supplychain.content.Content content, boolean sent)
          Method addContent stores a new Content object into the store.
 void fireAllProductContentData(java.lang.Class contentClass, boolean sent, java.lang.String productName)
          Method fireAllContentData.
 void fireAllProductNumberData(java.lang.String productName)
          Method fireAllNumberData.
 java.util.List getAllProductContent(java.lang.Class contentClass, boolean sent, java.lang.String productName)
          Method getAllProductContent returns the Content objects of type contentClass for a certain product
 java.util.List getAllProductContentData(java.lang.Class contentClass, boolean sent, java.lang.String productName)
          Method getAllProductContentData returns the Content object of type contentClass for a certain product in the form of data objects
 void removeSentReceivedContent(nl.tudelft.simulation.supplychain.content.Content content, boolean sent)
           
 void setSingleUserInteractionlayer(SingleUserInteractionLayerInterface singleUserInteractionLayer)
           
 
Methods inherited from class nl.tudelft.simulation.supplychain.content.LeanContentStore
internalDemandTimeout, orderBasedOnQuoteTimeout, orderStandAloneTimeout, quoteTimeout, removeContent, requestForQuoteTimeout
 
Methods inherited from class nl.tudelft.simulation.supplychain.content.ContentStore
foldExtendedContentClass, getContentList, getContentList, getOwner, removeAllContent, removeInternalDemand
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_ALL_NUMBER_DATA_EVENT

public static final nl.tudelft.simulation.event.EventType UPDATE_ALL_NUMBER_DATA_EVENT
the UPDATE_ALL_NUMBER_DATA_EVENT event


EVENT_ORDERCOMMIT_RECEIVED

public static final nl.tudelft.simulation.event.EventType EVENT_ORDERCOMMIT_RECEIVED
the event for the order confirmation received


EVENT_ORDERCOMMIT_SENT

public static final nl.tudelft.simulation.event.EventType EVENT_ORDERCOMMIT_SENT
the event for the order confirmation sent

Constructor Detail

GameActorContentStore

public GameActorContentStore(nl.tudelft.simulation.supplychain.actor.SupplyChainActor owner,
                             nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator)
Constructs a new GameActorContentStore

Parameters:
owner - the owner
simulator - the simulator
Method Detail

setSingleUserInteractionlayer

public void setSingleUserInteractionlayer(SingleUserInteractionLayerInterface singleUserInteractionLayer)
Parameters:
singleUserInteractionLayer - the interaction layer

addContent

public void addContent(nl.tudelft.simulation.supplychain.content.Content content,
                       boolean sent)
Method addContent stores a new Content object into the store.

Parameters:
content - the content to add
sent - indicates whether the content was sent or received

removeSentReceivedContent

public void removeSentReceivedContent(nl.tudelft.simulation.supplychain.content.Content content,
                                      boolean sent)
See Also:
ContentStore.removeSentReceivedContent(nl.tudelft.simulation.supplychain.content.Content, boolean)

getAllProductContentData

public java.util.List getAllProductContentData(java.lang.Class contentClass,
                                               boolean sent,
                                               java.lang.String productName)
Method getAllProductContentData returns the Content object of type contentClass for a certain product in the form of data objects

Parameters:
contentClass - the content class to look for
sent - indicates whether the content was sent or received
productName - the name of the product
Returns:
returns a list of all the content of type contentClass

getAllProductContent

public java.util.List getAllProductContent(java.lang.Class contentClass,
                                           boolean sent,
                                           java.lang.String productName)
Method getAllProductContent returns the Content objects of type contentClass for a certain product

Parameters:
contentClass - the content class to look for
sent - indicates whether the content was sent or received
productName - the name of the product
Returns:
returns a list of all the content of type contentClass

fireAllProductContentData

public void fireAllProductContentData(java.lang.Class contentClass,
                                      boolean sent,
                                      java.lang.String productName)
Method fireAllContentData.

Parameters:
contentClass - the content class to look for
sent - indicates whether the content was sent or received
productName - the name of the product

fireAllProductNumberData

public void fireAllProductNumberData(java.lang.String productName)
Method fireAllNumberData.

Parameters:
productName - the name of the product


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.