View Javadoc

1   /*
2    * sbxb library, part of ULMgen product
3    * Copyright (C) 2003,2005 Thierry Beigbeder
4    *
5    * This program is free software; you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation; either version 2 of the License, or
8    * (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  /*
20   * $Header: $
21   * $Revision: $
22   * $Date: $
23   *
24   * History :
25   * Who       yyyy/mm/dd   Action
26   * --------  ----------   ------
27   */
28  
29  
30  package org.otvl.sbxbsamp.simple;
31  
32  
33  // Insert here additional imports
34  
35  /***
36   * A house.
37   * @author
38   * @version
39   */
40  
41  
42  public class House
43  {
44  	/*-------------------------------------------------------------------------
45  	 * Attributes declaration
46  	 *-------------------------------------------------------------------------*/
47  	/***
48  	 * 
49  	 */
50  	private String address;
51  
52  
53  	/*-------------------------------------------------------------------------
54  	 * Associations declaration
55  	 *-------------------------------------------------------------------------*/
56  	/***
57  	 * The house's door.
58  	 */
59  	private Door theDoor;
60  	/***
61  	 * 
62  	 */
63  	private java.util.List rooms = new java.util.ArrayList() ;
64  
65  
66  	/*-------------------------------------------------------------------------
67  	 * Operations
68  	 *-------------------------------------------------------------------------*/
69  
70  
71  	/*-------------------------------------------------------------------------
72  	 * Attribute accessors
73  	 *-------------------------------------------------------------------------*/
74  	//------------------------
75  	// Accessors for attribute address
76  	//------------------------
77  	/***
78  	 * Returns the address.<br/>
79  	 * 
80  	 * @return String
81  	 */
82  	public String getAddress() {
83  		String vAddress = address;
84  		return vAddress;
85  	}
86  
87  	/***
88  	 * Sets the address.<br/>
89  	 * 
90  	 * @param address The address to set
91  	 */
92  	public void setAddress(String address) {
93  		this.address = address;
94  	}
95  
96  
97  
98  	/*-------------------------------------------------------------------------
99  	 * Association accessors
100 	 *-------------------------------------------------------------------------*/
101 	//--------------------------
102 	// Accessors for association theDoor
103 	//--------------------------
104 	/***
105 	 * Returns target of link theDoor.<br/>
106 	 * The house's door.
107 	 * @return Door
108 	 */
109 	public Door getTheDoor() {
110 		Door vTheDoor = theDoor;
111 		return vTheDoor;
112 	}
113 
114 	/***
115 	 * Sets target of link theDoor.<br/>
116 	 * The house's door.
117 	 * @param theDoor The theDoor to set
118 	 */
119 	public void setTheDoor(Door theDoor) {
120 		this.theDoor = theDoor;
121 	}
122 
123 	//--------------------------
124 	// Accessors for association rooms
125 	//--------------------------
126 	/***
127 	 * Returns a target in link rooms.<br/>
128 	 * 
129 	 * @param index offset in the array
130 	 * @return Room
131 	 */
132 	public Room getRooms(int index) {
133 		Room vRooms = (Room)rooms.get(index);
134 		return vRooms;
135 	}
136 	/***
137 	 * Returns an iterator for targets in links rooms
138 	 * @return java.util.Iterator
139 	 */
140 	public  java.util.Iterator iteratorRooms() {
141 		java.util.Iterator vIterator = rooms.iterator();
142 		return vIterator;
143 	}
144 	/***
145 	 * Returns the size of the collection rooms
146 	 * @return int
147 	 */
148 	public  int sizeRooms() {
149 		int vSize = rooms.size();
150 		return vSize;
151 	}
152 
153 	/***
154 	 * Inserts a target in link rooms.<br/>
155 	 * 
156 	 * @param index offset in the list
157 	 * @param aRoom The Room to insert
158 	 */
159 	public void addRooms(int index, Room aRoom) {
160 		this.rooms.add(index, aRoom);
161 	}
162 	/***
163 	 * Adds a target at end of link rooms.<br/>
164 	 * 
165 	 * @param aRoom The Room to insert
166 	 */
167 	public void addRooms(Room aRoom) {
168 		this.rooms.add(this.rooms.size(), aRoom);
169 	}
170 	
171 	/***
172 	 * Removes a target in link rooms
173 	 * @param index offset in the list
174 	 */
175 	public void removeRooms(int index) {
176 		this.rooms.remove(index);
177 	}
178 	
179 	/***
180 	 * Clears all targets in link rooms
181 	 */
182 	public void clearRooms() {
183 		this.rooms.clear();
184 	}
185 
186 
187 
188 
189 }