Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ObjectNameNotUniqueException |
|
| 1.0;1 |
1 | package org.odmg; | |
2 | ||
3 | ||
4 | ||
5 | /** | |
6 | ||
7 | * This exception is thrown when attempting to bind a name to an object | |
8 | ||
9 | * when the name is already bound to another object. | |
10 | ||
11 | * @author David Jordan (as Java Editor of the Object Data Management Group) | |
12 | ||
13 | * @version ODMG 3.0 | |
14 | ||
15 | * @see org.odmg.Database#bind | |
16 | ||
17 | */ | |
18 | ||
19 | ||
20 | ||
21 | public class ObjectNameNotUniqueException extends ODMGException | |
22 | ||
23 | { | |
24 | ||
25 | /* | |
26 | ||
27 | private Object o; | |
28 | ||
29 | private String n; | |
30 | ||
31 | public ObjectNameNotUniqueException(Object obj, String name) | |
32 | ||
33 | { | |
34 | ||
35 | super(); | |
36 | ||
37 | o = obj; | |
38 | ||
39 | n = name; | |
40 | ||
41 | } | |
42 | ||
43 | ||
44 | ||
45 | ||
46 | ||
47 | * Get the object that was passed to Database.bind. | |
48 | ||
49 | * @return The object that was being bound to a name. | |
50 | ||
51 | ||
52 | ||
53 | public Object getObject() | |
54 | ||
55 | { | |
56 | ||
57 | return o; | |
58 | ||
59 | } | |
60 | ||
61 | ||
62 | ||
63 | ||
64 | ||
65 | * Get the name that is not unique. | |
66 | ||
67 | * @return The name that is already associated with another object. | |
68 | ||
69 | ||
70 | ||
71 | public String getName() | |
72 | ||
73 | { | |
74 | ||
75 | return n; | |
76 | ||
77 | } | |
78 | ||
79 | */ | |
80 | ||
81 | /* | |
82 | ||
83 | private Object o; | |
84 | ||
85 | private String n; | |
86 | ||
87 | public ObjectNameNotUniqueException(Object obj, String name) | |
88 | ||
89 | { | |
90 | ||
91 | super(); | |
92 | ||
93 | o = obj; | |
94 | ||
95 | n = name; | |
96 | ||
97 | } | |
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | * Get the object that was passed to Database.bind. | |
104 | ||
105 | * @return The object that was being bound to a name. | |
106 | ||
107 | ||
108 | ||
109 | public Object getObject() | |
110 | ||
111 | { | |
112 | ||
113 | return o; | |
114 | ||
115 | } | |
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 | * Get the name that is not unique. | |
122 | ||
123 | * @return The name that is already associated with another object. | |
124 | ||
125 | ||
126 | ||
127 | public String getName() | |
128 | ||
129 | { | |
130 | ||
131 | return n; | |
132 | ||
133 | } | |
134 | ||
135 | */ | |
136 | ||
137 | /* | |
138 | ||
139 | private Object o; | |
140 | ||
141 | private String n; | |
142 | ||
143 | public ObjectNameNotUniqueException(Object obj, String name) | |
144 | ||
145 | { | |
146 | ||
147 | super(); | |
148 | ||
149 | o = obj; | |
150 | ||
151 | n = name; | |
152 | ||
153 | } | |
154 | ||
155 | ||
156 | ||
157 | ||
158 | ||
159 | * Get the object that was passed to Database.bind. | |
160 | ||
161 | * @return The object that was being bound to a name. | |
162 | ||
163 | ||
164 | ||
165 | public Object getObject() | |
166 | ||
167 | { | |
168 | ||
169 | return o; | |
170 | ||
171 | } | |
172 | ||
173 | ||
174 | ||
175 | ||
176 | ||
177 | * Get the name that is not unique. | |
178 | ||
179 | * @return The name that is already associated with another object. | |
180 | ||
181 | ||
182 | ||
183 | public String getName() | |
184 | ||
185 | { | |
186 | ||
187 | return n; | |
188 | ||
189 | } | |
190 | ||
191 | */ | |
192 | ||
193 | /** | |
194 | ||
195 | * Construct an instance of the exception. | |
196 | ||
197 | */ | |
198 | ||
199 | public ObjectNameNotUniqueException() | |
200 | ||
201 | { | |
202 | ||
203 | super(); | |
204 | ||
205 | } | |
206 | ||
207 | ||
208 | ||
209 | /** | |
210 | ||
211 | * Construct an instance of the exception with a descriptive message. | |
212 | ||
213 | * @param msg A message containing a description of the exception. | |
214 | ||
215 | */ | |
216 | ||
217 | public ObjectNameNotUniqueException(String msg) | |
218 | ||
219 | { | |
220 | ||
221 | super(msg); | |
222 | ||
223 | } | |
224 | ||
225 | /* | |
226 | ||
227 | private Object o; | |
228 | ||
229 | private String n; | |
230 | ||
231 | public ObjectNameNotUniqueException(Object obj, String name) | |
232 | ||
233 | { | |
234 | ||
235 | super(); | |
236 | ||
237 | o = obj; | |
238 | ||
239 | n = name; | |
240 | ||
241 | } | |
242 | ||
243 | ||
244 | ||
245 | ||
246 | ||
247 | * Get the object that was passed to Database.bind. | |
248 | ||
249 | * @return The object that was being bound to a name. | |
250 | ||
251 | ||
252 | ||
253 | public Object getObject() | |
254 | ||
255 | { | |
256 | ||
257 | return o; | |
258 | ||
259 | } | |
260 | ||
261 | ||
262 | ||
263 | ||
264 | ||
265 | * Get the name that is not unique. | |
266 | ||
267 | * @return The name that is already associated with another object. | |
268 | ||
269 | ||
270 | ||
271 | public String getName() | |
272 | ||
273 | { | |
274 | ||
275 | return n; | |
276 | ||
277 | } | |
278 | ||
279 | */ | |
280 | ||
281 | } | |
282 |