View Javadoc

1   /*
2    * QuoteData.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.Quote;
20  
21  import org.gscg.singleuser.interactionlayer.dataobjects.DateIntData;
22  
23  /***
24   * Contains data for a quote. This object is send to a client-side graphical
25   * user interface and is used to update information related to a quote.
26   * <p>
27   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
28   * Delft, the Netherlands. All rights reserved.
29   * 
30   * See for project information <a href="http://www.simulation.tudelft.nl/">
31   * www.simulation.tudelft.nl </a>.
32   * 
33   * The source code and binary code of this software is proprietary information
34   * of Delft University of Technology.
35   * 
36   * @author <a
37   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
38   *         van Houten </a>
39   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:56 $
40   * @since 1.0.0
41   */
42  public class QuoteData extends ContentData implements Serializable
43  {
44  	/*** the serial version uid */
45  	private static final long serialVersionUID = 11L;
46  
47  	/*** the RFQ */
48  	private RFQData rfqData = null;
49  
50  	/*** the proposed delivery */
51  	private DateIntData proposedDelivery = null;
52  
53  	/*** the amount */
54  	private double amount = 0;
55  
56  	/*** the product name */
57  	private String productName = null;
58  
59  	/*** the proposed price */
60  	private double price = 0.0;
61  
62  	/***
63  	 * constructs a new QuoteData
64  	 * 
65  	 * @param quote the quote
66  	 * @param simulator the simulator
67  	 */
68  	public QuoteData(final Quote quote, final SimulatorInterface simulator)
69  	{
70  		super(quote.getSender().getName(), quote.getSender()
71  				.getLocationDescription(), quote.getReceiver().getName(), quote
72  				.getReceiver().getLocationDescription());
73  		this.rfqData = new RFQData(quote.getRequestForQuote(), simulator);
74  		this.proposedDelivery = DateIntData.makeDateIntData(quote
75  				.getProposedDeliveryDate(), simulator);
76  		this.amount = quote.getAmount();
77  		this.productName = quote.getProduct().getName();
78  		this.price = quote.getPrice();
79  	}
80  
81  	/***
82  	 * @return Returns the amount.
83  	 */
84  	public double getAmount()
85  	{
86  		return this.amount;
87  	}
88  
89  	/***
90  	 * @return Returns the price.
91  	 */
92  	public double getPrice()
93  	{
94  		return Math.round(this.price);
95  	}
96  
97  	/***
98  	 * @return Returns the productName.
99  	 */
100 	public String getProductName()
101 	{
102 		return this.productName;
103 	}
104 
105 	/***
106 	 * @return Returns the proposedDelivery.
107 	 */
108 	public DateIntData getProposedDelivery()
109 	{
110 		return this.proposedDelivery;
111 	}
112 
113 	/***
114 	 * @return Returns the rfqData.
115 	 */
116 	public RFQData getRfqData()
117 	{
118 		return this.rfqData;
119 	}
120 }