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.abcref;
31  
32  
33  // Insert here additional imports
34  
35  
36  
37  
38  /***
39   * 
40   * @author
41   * @version
42   */
43  
44  
45  public class ARefee
46  	extends BaseRefee
47  
48  {
49  	/*-------------------------------------------------------------------------
50  	 * Attributes declaration
51  	 *-------------------------------------------------------------------------*/
52  	/***
53  	 * 
54  	 */
55  	private int id;
56  
57  
58  	/*-------------------------------------------------------------------------
59  	 * Associations declaration
60  	 *-------------------------------------------------------------------------*/
61  	/***
62  	 * 
63  	 */
64  	private java.util.List cByRef = new java.util.ArrayList() ;
65  
66  
67  	/*-------------------------------------------------------------------------
68  	 * Operations
69  	 *-------------------------------------------------------------------------*/
70  	/***
71  	 * Provides a unique reference for the current object.
72  	 * The class implementing the reference must implement hashcode/equals.
73  	 * @return Object
74  	 */
75  	protected Object doGetReference() 
76  	{
77  		Object vDoGetReference;
78  
79  		vDoGetReference = new ABCRef(getClass(),"" + id);
80  		return vDoGetReference;
81  
82  	}
83  	/***
84  	 * Called when a reference has been instantiated and updated after successful parsing.
85  	 * May be implemented by a referencee to update its state from the state of the reference.
86  	 * @param ref 
87  	 */
88  	public void doSetSbxbReference(
89  		Object ref
90  	) 
91  	{
92  		
93  		ABCRef rr = (ABCRef)ref;
94  		id = new Integer(rr.id).intValue();
95  		
96  	}
97  
98  
99  	/*-------------------------------------------------------------------------
100 	 * Attribute accessors
101 	 *-------------------------------------------------------------------------*/
102 	//------------------------
103 	// Accessors for attribute id
104 	//------------------------
105 	/***
106 	 * Returns the id.<br/>
107 	 * 
108 	 * @return int
109 	 */
110 	public int getId() {
111 		int vId = id;
112 		return vId;
113 	}
114 
115 	/***
116 	 * Sets the id.<br/>
117 	 * 
118 	 * @param id The id to set
119 	 */
120 	public void setId(int id) {
121 		this.id = id;
122 	}
123 
124 
125 
126 	/*-------------------------------------------------------------------------
127 	 * Association accessors
128 	 *-------------------------------------------------------------------------*/
129 	//--------------------------
130 	// Accessors for association cByRef
131 	//--------------------------
132 	/***
133 	 * Returns a target in link cByRef.<br/>
134 	 * 
135 	 * @param index offset in the array
136 	 * @return CRefee
137 	 */
138 	public CRefee getCByRef(int index) {
139 		CRefee vCByRef = (CRefee)cByRef.get(index);
140 		return vCByRef;
141 	}
142 	/***
143 	 * Returns an iterator for targets in links cByRef
144 	 * @return java.util.Iterator
145 	 */
146 	public  java.util.Iterator iteratorCByRef() {
147 		java.util.Iterator vIterator = cByRef.iterator();
148 		return vIterator;
149 	}
150 	/***
151 	 * Returns the size of the collection cByRef
152 	 * @return int
153 	 */
154 	public  int sizeCByRef() {
155 		int vSize = cByRef.size();
156 		return vSize;
157 	}
158 
159 	/***
160 	 * Inserts a target in link cByRef.<br/>
161 	 * 
162 	 * @param index offset in the list
163 	 * @param aCRefee The CRefee to insert
164 	 */
165 	public void addCByRef(int index, CRefee aCRefee) {
166 		this.cByRef.add(index, aCRefee);
167 	}
168 	/***
169 	 * Adds a target at end of link cByRef.<br/>
170 	 * 
171 	 * @param aCRefee The CRefee to insert
172 	 */
173 	public void addCByRef(CRefee aCRefee) {
174 		this.cByRef.add(this.cByRef.size(), aCRefee);
175 	}
176 	
177 	/***
178 	 * Removes a target in link cByRef
179 	 * @param index offset in the list
180 	 */
181 	public void removeCByRef(int index) {
182 		this.cByRef.remove(index);
183 	}
184 	
185 	/***
186 	 * Clears all targets in link cByRef
187 	 */
188 	public void clearCByRef() {
189 		this.cByRef.clear();
190 	}
191 
192 
193 
194 
195 }