1
2
3
4
5
6
7
8
9
10
11
12
13
14 package nl.tudelft.simulation.supplychain.content;
15
16 import java.io.Serializable;
17
18 import nl.tudelft.simulation.supplychain.actor.SupplyChainActor;
19 import nl.tudelft.simulation.supplychain.product.Product;
20
21 /***
22 * The YellowPageAnswer is the answer from a Yellow Page actor to a
23 * YellowPageRequest. It contains a list of actors that might sell a product or
24 * service that was asked for in the YellowPageRequest. <br>
25 * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
26 * Delft, the Netherlands. All rights reserved.
27 *
28 * See for project information <a href="http://www.simulation.tudelft.nl/">
29 * www.simulation.tudelft.nl </a>.
30 *
31 * The source code and binary code of this software is proprietary information
32 * of Delft University of Technology.
33 *
34 * @author <a
35 * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
36 * Verbraeck </a>
37 * @version $$Revision: 1.3 $$ $$Date: 2005/04/08 12:00:56 $$
38 */
39 public class YellowPageAnswer extends Content
40 {
41 /*** the serial version uid */
42 private static final long serialVersionUID = 12L;
43
44 /*** the suppliers of the requested product */
45 private SupplyChainActor[] suppliers = null;
46
47 /*** the request that triggered this yellow page anawer */
48 private YellowPageRequest ypRequest = null;
49
50 /***
51 * Constructs a new YellowPageAnswer.
52 *
53 * @param sender the sender of the yellow page answer
54 * @param receiver the receiver of the yellow page answer
55 * @param internalDemandID the internal demand that triggered the yellow
56 * page process
57 * @param suppliers the suppliers of the requested product
58 * @param ypRequest the request that triggered this YP answer
59 */
60 public YellowPageAnswer(final SupplyChainActor sender,
61 final SupplyChainActor receiver,
62 final Serializable internalDemandID,
63 final SupplyChainActor[] suppliers,
64 final YellowPageRequest ypRequest)
65 {
66 super(sender, receiver, internalDemandID);
67 this.suppliers = suppliers;
68 this.ypRequest = ypRequest;
69 }
70
71 /***
72 * @return Returns the suppliers.
73 */
74 public SupplyChainActor[] getSuppliers()
75 {
76 return this.suppliers;
77 }
78
79 /***
80 * @return Returns the request for which this is the answer.
81 */
82 public YellowPageRequest getYellowPageRequest()
83 {
84 return this.ypRequest;
85 }
86
87 /***
88 * @see nl.tudelft.simulation.supplychain.content.Content#getProduct()
89 */
90 public Product getProduct()
91 {
92 return this.ypRequest.getProduct();
93 }
94
95 /***
96 * @see java.lang.Object#toString()
97 */
98 public String toString()
99 {
100 return super.toString() + ", for "
101 + this.getYellowPageRequest().toString();
102 }
103 }