View Javadoc

1   /*
2    * OrderBasedOnQuoteData.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 nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
17  import nl.tudelft.simulation.supplychain.content.OrderStandAlone;
18  
19  /***
20   * Contains data for an order. This object is send to a client-side graphical
21   * user interface and is used to update information related to an order.
22   * <p>
23   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
24   * Delft, the Netherlands. All rights reserved.
25   * 
26   * See for project information <a href="http://www.simulation.tudelft.nl/">
27   * www.simulation.tudelft.nl </a>.
28   * 
29   * The source code and binary code of this software is proprietary information
30   * of Delft University of Technology.
31   * 
32   * @author <a
33   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
34   *         van Houten </a>
35   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:55 $
36   * @since 1.0.0
37   */
38  public class OrderStandAloneData extends OrderData
39  {
40  	/*** the serial version uid */
41  	private static final long serialVersionUID = 11L;
42  
43  	/*** the amount */
44  	private double amount = 0;
45  
46  	/*** the product name */
47  	private String productName = null;
48  
49  	/*** the proposed price */
50  	private double price = 0.0;
51  
52  	/***
53  	 * constructs a new OrderBasedOnQuoteData
54  	 * 
55  	 * @param order the order to extract data from
56  	 * @param simulator the simulator
57  	 */
58  	public OrderStandAloneData(final OrderStandAlone order,
59  			final SimulatorInterface simulator)
60  	{
61  		super(order, simulator);
62  		this.amount = order.getAmount();
63  		this.price = order.getPrice();
64  		this.productName = order.getProduct().getName();
65  	}
66  
67  	/***
68  	 * @see org.gscg.singleuser.interactionlayer.dataobjects.content.OrderData#getAmount()
69  	 */
70  	public double getAmount()
71  	{
72  		return this.amount;
73  	}
74  
75  	/***
76  	 * @see org.gscg.singleuser.interactionlayer.dataobjects.content.OrderData#getPrice()
77  	 */
78  	public double getPrice()
79  	{
80  		return Math.round(this.price);
81  	}
82  
83  	/***
84  	 * @see org.gscg.singleuser.interactionlayer.dataobjects.content.OrderData#getProductName()
85  	 */
86  	public String getProductName()
87  	{
88  		return this.productName;
89  	}
90  }