View Javadoc

1   /*
2    * CurrentRowOrColumnData.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;
15  
16  import java.io.Serializable;
17  
18  import org.gscg.common.interactionlayer.dataobjects.DataInterface;
19  
20  /***
21   * The CurrentRowOrColumnData reflects a data object meant for client side. It
22   * includes the up-to-date values for the day, month and year in a game.
23   * <p>
24   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
25   * Delft, the Netherlands. All rights reserved.
26   * 
27   * See for project information <a href="http://www.simulation.tudelft.nl/">
28   * www.simulation.tudelft.nl </a>.
29   * 
30   * The source code and binary code of this software is proprietary information
31   * of Delft University of Technology.
32   * 
33   * @author <a
34   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
35   *         van Houten </a>
36   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:59 $
37   * @since 1.0.0
38   */
39  public class CurrentRowOrColumnData implements Serializable, DataInterface
40  {
41  	/*** the serial version uid */
42  	private static final long serialVersionUID = 11L;
43  
44  	/***
45  	 * fired when the current row or column must be updated according to the
46  	 * simulation time
47  	 */
48  	public static final String UPDATE_CURRENT_DAY = "UPDATE_CURRENT_DAY";
49  
50  	/***
51  	 * fired when the current row or column must be updated according to the
52  	 * simulation time
53  	 */
54  	public static final String UPDATE_CURRENT_MONTH = "UPDATE_CURRENT_MONTH";
55  
56  	/***
57  	 * fired when the current row or column must be updated according to the
58  	 * simulation time
59  	 */
60  	public static final String UPDATE_CURRENT_YEAR = "UPDATE_CURRENT_YEAR";
61  
62  	/*** the day */
63  	private int day = 0;
64  
65  	/*** the month */
66  	private int month = 0;
67  
68  	/*** the year */
69  	private int year = 0;
70  
71  	/***
72  	 * constructs a new CurrentRowOrColumnData
73  	 * 
74  	 * @param day the day
75  	 * @param month the month
76  	 * @param year the year
77  	 */
78  	public CurrentRowOrColumnData(final int day, final int month, final int year)
79  	{
80  		super();
81  		this.day = day;
82  		this.month = month;
83  		this.year = year;
84  	}
85  
86  	/***
87  	 * @see org.gscg.common.interactionlayer.dataobjects.DataInterface#getData(java.lang.String)
88  	 */
89  	public String getData(final String key)
90  	{
91  		if (key.equals(CurrentRowOrColumnData.UPDATE_CURRENT_DAY))
92  		{
93  			return "" + this.day;
94  		}
95  		if (key.equals(CurrentRowOrColumnData.UPDATE_CURRENT_MONTH))
96  		{
97  			return "" + this.month;
98  		}
99  		if (key.equals(CurrentRowOrColumnData.UPDATE_CURRENT_YEAR))
100 		{
101 			return "" + this.year;
102 		}
103 		return null;
104 	}
105 }