View Javadoc

1   /*
2    * LocationObject.java Created @ Jun 10, 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.common.interactionlayer.dataobjects;
15  
16  import java.io.Serializable;
17  
18  import nl.tudelft.simulation.language.d3.DirectedPoint;
19  
20  /***
21   * The LocationAndNameData object contains the information with regards to the
22   * differnt actors in an interactive simulation. Whenever an actor is added or
23   * removed, and upon initialization this object is send to client-side grapbical
24   * user interfaces in order to update the WorldPanel. These data objects are
25   * sent by the YellowPage object.
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:58 $
40   * @since 1.0.0
41   */
42  public class LocationAndNameData implements Serializable
43  {
44  	/*** the serial version uid */
45  	private static final long serialVersionUID = 11L;
46  
47  	/*** the supplier type */
48  	public static final String ACTORTYPE_SUPPLIER = "supplier";
49  
50  	/*** the manufacturer type */
51  	public static final String ACTORTYPE_MANUFACTURER = "manufacturer";
52  
53  	/*** the dc type */
54  	public static final String ACTORTYPE_DC = "retailer";
55  
56  	/*** the retailer type */
57  	public static final String ACTORTYPE_RETAILER = "retailer";
58  
59  	/*** the market type */
60  	public static final String ACTORTYPE_MARKET = "customer";
61  
62  	/*** the customer type */
63  	public static final String ACTORTYPE_CUSTOMER = "customer";
64  
65  	/*** the location */
66  	private DirectedPoint location = null;
67  
68  	/*** the name */
69  	private String name = "";
70  
71  	/*** the type of actor */
72  	private String actorType;
73  
74  	/*** indicates whether an actor is human controlled or not */
75  	private boolean interactive = false;
76  
77  	/*** indicates whether a human controlled actor is online or not */
78  	private boolean status = false;
79  
80  	/***
81  	 * constructs a new LocationAndNameData
82  	 */
83  	public LocationAndNameData()
84  	{
85  		super();
86  	}
87  
88  	/***
89  	 * constructs a new LocationObject
90  	 * 
91  	 * @param location the location
92  	 * @param name the name
93  	 * @param actorType the type of actor
94  	 * @param interactive indicates whether the actor is human controlled or not
95  	 */
96  	public LocationAndNameData(final DirectedPoint location, final String name,
97  			final String actorType, final boolean interactive)
98  	{
99  		super();
100 		this.location = location;
101 		this.name = name;
102 		this.actorType = actorType;
103 		this.interactive = interactive;
104 	}
105 
106 	/***
107 	 * Method isStatus.
108 	 * 
109 	 * @return returns true if human controlled actor is online
110 	 */
111 	public boolean isStatus()
112 	{
113 		return this.status;
114 	}
115 
116 	/***
117 	 * 
118 	 * Method setStatus.
119 	 * 
120 	 * @param status true if the human controlled actor is online
121 	 */
122 	public void setStatus(final boolean status)
123 	{
124 		this.status = status;
125 	}
126 
127 	/***
128 	 * @return Returns the location.
129 	 */
130 	public DirectedPoint getLocation()
131 	{
132 		return this.location;
133 	}
134 
135 	/***
136 	 * @return Returns the name.
137 	 */
138 	public String getName()
139 	{
140 		return this.name;
141 	}
142 
143 	/***
144 	 * @param location The location to set.
145 	 */
146 	public void setLocation(final DirectedPoint location)
147 	{
148 		this.location = location;
149 	}
150 
151 	/***
152 	 * @param name The name to set.
153 	 */
154 	public void setName(final String name)
155 	{
156 		this.name = name;
157 	}
158 
159 	/***
160 	 * @return Returns the actorType.
161 	 */
162 	public String getActorType()
163 	{
164 		return this.actorType;
165 	}
166 
167 	/***
168 	 * @param actorType The actorType to set.
169 	 */
170 	public void setActorType(final String actorType)
171 	{
172 		this.actorType = actorType;
173 	}
174 
175 	/***
176 	 * Method isInteractive.
177 	 * 
178 	 * @return returns a boolean indicating whether the actor is human
179 	 *         controlled or not
180 	 */
181 	public boolean isInteractive()
182 	{
183 		return this.interactive;
184 	}
185 }