View Javadoc

1   /*
2    * OrderData.java Created @ Jul 7, 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.interactionlayer.dataobjects.content;
15  
16  import java.io.Serializable;
17  
18  import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
19  import nl.tudelft.simulation.supplychain.content.Order;
20  import nl.tudelft.simulation.supplychain.content.OrderBasedOnQuote;
21  
22  import org.gscg.singleuser.interactionlayer.dataobjects.DateIntData;
23  
24  /***
25   * Contains data for an order. This object is send to a client-side graphical
26   * user interface and is used to update information related to an order.
27   * <p>
28   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
29   * Delft, the Netherlands. All rights reserved.
30   * 
31   * See for project information <a href="http://www.simulation.tudelft.nl/">
32   * www.simulation.tudelft.nl </a>.
33   * 
34   * The source code and binary code of this software is proprietary information
35   * of Delft University of Technology.
36   * 
37   * @author <a
38   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
39   *         van Houten </a>
40   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:56 $
41   * @since 1.0.0
42   */
43  public abstract class OrderData extends ContentData
44  {
45  	/*** the proposed delivery date */
46  	private DateIntData deliveryDate = null;
47  
48  	/*** the proposed shipping date */
49  	private DateIntData proposedShippingDate = null;
50  
51  	/*** the internal demand id */
52  	private Serializable internalDemandID = null;
53  
54  	/***
55  	 * constructs a new OrderData
56  	 * 
57  	 * @param order the order to extract data from
58  	 * @param simulator the simulator
59  	 */
60  	public OrderData(final Order order, final SimulatorInterface simulator)
61  	{
62  		super(order.getSender().getName(), order.getSender()
63  				.getLocationDescription(), order.getReceiver().getName(), order
64  				.getReceiver().getLocationDescription());
65  		this.deliveryDate = DateIntData.makeDateIntData(
66  				order.getDeliveryDate(), simulator);
67  		this.proposedShippingDate = DateIntData.makeDateIntData(
68  				((OrderBasedOnQuote) order).getQuote()
69  						.getProposedShippingDate(), simulator);
70  		this.internalDemandID = order.getInternalDemandID();
71  	}
72  
73  	/***
74  	 * @return Returns the deliveryDate.
75  	 */
76  	public DateIntData getDeliveryDate()
77  	{
78  		return this.deliveryDate;
79  	}
80  
81  	/***
82  	 * @return Returns the proposed shipping date.
83  	 */
84  	public DateIntData getProposedShippingDate()
85  	{
86  		return this.proposedShippingDate;
87  	}
88  
89  	/***
90  	 * @return Returns the internal demand id
91  	 */
92  	public Serializable getInternalDemandID()
93  	{
94  		return this.internalDemandID;
95  	}
96  
97  	/***
98  	 * @return Returns the amount.
99  	 */
100 	public abstract double getAmount();
101 
102 	/***
103 	 * @return Returns the price.
104 	 */
105 	public abstract double getPrice();
106 
107 	/***
108 	 * @return Returns the productName.
109 	 */
110 	public abstract String getProductName();
111 
112 }