View Javadoc

1   /*
2    * InteractiveInternalDemandHandler.java Created @ Mar 4, 2004
3    * 
4    * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands. All rights reserved.
6    * 
7    * See for project information <a href="http://www.simulation.tudelft.nl/">
8    * www.simulation.tudelft.nl </a>.
9    * 
10   * The source code and binary code of this software is proprietary information
11   * of Delft University of Technology.
12   */
13  
14  package org.gscg.singleuser.handlers;
15  
16  import java.io.Serializable;
17  
18  import nl.tudelft.simulation.supplychain.actor.SupplyChainActor;
19  import nl.tudelft.simulation.supplychain.content.InternalDemand;
20  import nl.tudelft.simulation.supplychain.handlers.SupplyChainHandler;
21  
22  /***
23   * The InteractiveInternalDemandHandler is a simple implementation of the
24   * business logic for an InternalDemand that comes in. <br>
25   * <br>
26   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
27   * Delft, the Netherlands. All rights reserved.
28   * 
29   * See for project information <a href="http://www.simulation.tudelft.nl/">
30   * www.simulation.tudelft.nl </a>.
31   * 
32   * The source code and binary code of this software is proprietary information
33   * of Delft University of Technology.
34   * 
35   * @author <a
36   *         href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
37   *         Verbraeck </a>
38   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:56 $
39   * @since 1.0.0
40   */
41  public class InteractiveInternalDemandHandler extends SupplyChainHandler
42  {
43  	/*** the serial version uid */
44  	private static final long serialVersionUID = 11L;
45  
46  	/***
47  	 * Constructs a new InteractiveOrderConfirmationFineHandler.
48  	 * 
49  	 * @param owner the owner of the handler.
50  	 */
51  	public InteractiveInternalDemandHandler(final SupplyChainActor owner)
52  	{
53  		super(owner);
54  	}
55  
56  	/***
57  	 * @see nl.tudelft.simulation.content.HandlerInterface#handleContent(java.io.Serializable)
58  	 */
59  	public boolean handleContent(final Serializable content)
60  	{
61  		InternalDemand internalDemand = (InternalDemand) checkContent(content);
62  		if (!isValidContent(internalDemand))
63  		{
64  			return false;
65  		}
66  		return true;
67  	}
68  
69  	/***
70  	 * @see nl.tudelft.simulation.supplychain.handlers.SupplyChainHandler#checkContentClass(java.io.Serializable)
71  	 */
72  	protected boolean checkContentClass(final Serializable content)
73  	{
74  		return (content instanceof InternalDemand);
75  	}
76  }