@@ -19,7 +19,7 @@ namespace NHibernate.Collection
19
19
[ Serializable ]
20
20
public class Set : PersistentCollection , Iesi . Collections . ISet
21
21
{
22
- protected Iesi . Collections . ISet _set ;
22
+ protected Iesi . Collections . ISet internalSet ;
23
23
24
24
[ NonSerialized ] protected IList tempIdentifierList ;
25
25
@@ -30,8 +30,8 @@ public class Set : PersistentCollection, Iesi.Collections.ISet
30
30
/// </summary>
31
31
protected override object Snapshot ( CollectionPersister persister )
32
32
{
33
- Hashtable clonedMap = new Hashtable ( _set . Count ) ;
34
- foreach ( object obj in _set )
33
+ Hashtable clonedMap = new Hashtable ( internalSet . Count ) ;
34
+ foreach ( object obj in internalSet )
35
35
{
36
36
object copied = persister . ElementType . DeepCopy ( obj ) ;
37
37
clonedMap [ copied ] = copied ;
@@ -44,7 +44,7 @@ public override ICollection GetOrphans(object snapshot)
44
44
IDictionary sn = ( IDictionary ) snapshot ;
45
45
ArrayList result = new ArrayList ( sn . Keys . Count ) ;
46
46
result . AddRange ( sn . Keys ) ;
47
- PersistentCollection . IdentityRemoveAll ( result , _set , session ) ;
47
+ PersistentCollection . IdentityRemoveAll ( result , internalSet , session ) ;
48
48
return result ;
49
49
}
50
50
@@ -54,13 +54,13 @@ public override ICollection GetOrphans(object snapshot)
54
54
public override bool EqualsSnapshot ( IType elementType )
55
55
{
56
56
IDictionary snapshot = ( IDictionary ) GetSnapshot ( ) ;
57
- if ( snapshot . Count != _set . Count )
57
+ if ( snapshot . Count != internalSet . Count )
58
58
{
59
59
return false ;
60
60
}
61
61
else
62
62
{
63
- foreach ( object obj in _set )
63
+ foreach ( object obj in internalSet )
64
64
{
65
65
object oldValue = snapshot [ obj ] ;
66
66
if ( oldValue == null || elementType . IsDirty ( oldValue , obj , session ) )
@@ -85,7 +85,7 @@ public Set(ISessionImplementor session) : base(session) { }
85
85
/// </remarks>
86
86
public Set ( ISessionImplementor session , Iesi . Collections . ISet collection ) : base ( session )
87
87
{
88
- _set = collection ;
88
+ internalSet = collection ;
89
89
initialized = true ;
90
90
directlyAccessible = true ;
91
91
}
@@ -97,7 +97,7 @@ public Set(ISessionImplementor session, CollectionPersister persister, object di
97
97
object [ ] array = ( object [ ] ) disassembled ;
98
98
for ( int i = 0 ; i < array . Length ; i += 2 )
99
99
{
100
- _set . Add ( persister . ElementType . Assemble ( array [ i ] , session , owner ) ) ;
100
+ internalSet . Add ( persister . ElementType . Assemble ( array [ i ] , session , owner ) ) ;
101
101
}
102
102
initialized = true ;
103
103
}
@@ -109,11 +109,11 @@ public override void BeforeInitialize(CollectionPersister persister) {
109
109
110
110
if ( persister . HasOrdering )
111
111
{
112
- _set = new Iesi . Collections . ListSet ( ) ;
112
+ internalSet = new Iesi . Collections . ListSet ( ) ;
113
113
}
114
114
else
115
115
{
116
- _set = new Iesi . Collections . HashedSet ( ) ;
116
+ internalSet = new Iesi . Collections . HashedSet ( ) ;
117
117
}
118
118
}
119
119
@@ -127,7 +127,7 @@ public override void BeforeInitialize(CollectionPersister persister) {
127
127
public override void CopyTo ( System . Array array , int index )
128
128
{
129
129
Read ( ) ;
130
- _set . CopyTo ( array , index ) ;
130
+ internalSet . CopyTo ( array , index ) ;
131
131
}
132
132
133
133
/// <summary>
@@ -138,7 +138,7 @@ public override int Count
138
138
get
139
139
{
140
140
Read ( ) ;
141
- return _set . Count ;
141
+ return internalSet . Count ;
142
142
}
143
143
}
144
144
@@ -165,96 +165,80 @@ public override object SyncRoot
165
165
public bool Add ( object value )
166
166
{
167
167
Write ( ) ;
168
- return _set . Add ( value ) ;
168
+ return internalSet . Add ( value ) ;
169
169
}
170
170
171
171
public void Clear ( )
172
172
{
173
173
Write ( ) ;
174
- _set . Clear ( ) ;
174
+ internalSet . Clear ( ) ;
175
175
}
176
176
177
177
public bool Contains ( object key )
178
178
{
179
179
Read ( ) ;
180
- return _set . Contains ( key ) ;
180
+ return internalSet . Contains ( key ) ;
181
181
}
182
182
183
183
public bool ContainsAll ( ICollection c )
184
184
{
185
185
Read ( ) ;
186
- return _set . ContainsAll ( c ) ;
186
+ return internalSet . ContainsAll ( c ) ;
187
187
}
188
188
189
189
public Iesi . Collections . ISet ExclusiveOr ( Iesi . Collections . ISet a )
190
190
{
191
191
Read ( ) ;
192
- return _set . ExclusiveOr ( a ) ;
192
+ return internalSet . ExclusiveOr ( a ) ;
193
193
}
194
194
195
195
public Iesi . Collections . ISet Intersect ( Iesi . Collections . ISet a )
196
196
{
197
197
Read ( ) ;
198
- return _set . Intersect ( a ) ;
198
+ return internalSet . Intersect ( a ) ;
199
199
}
200
200
201
201
public bool IsEmpty
202
202
{
203
203
get
204
204
{
205
205
Read ( ) ;
206
- return _set . IsEmpty ;
206
+ return internalSet . IsEmpty ;
207
207
}
208
208
}
209
209
210
210
public Iesi . Collections . ISet Minus ( Iesi . Collections . ISet a )
211
211
{
212
212
Read ( ) ;
213
- return _set . Minus ( a ) ;
213
+ return internalSet . Minus ( a ) ;
214
214
}
215
215
216
216
public bool Remove ( object key )
217
217
{
218
218
Write ( ) ;
219
- return _set . Remove ( key ) ;
219
+ return internalSet . Remove ( key ) ;
220
220
}
221
221
222
222
public bool RemoveAll ( ICollection c )
223
223
{
224
224
Write ( ) ;
225
- return _set . RemoveAll ( c ) ;
225
+ return internalSet . RemoveAll ( c ) ;
226
226
}
227
227
228
228
public bool RetainAll ( ICollection c )
229
229
{
230
230
Write ( ) ;
231
- return _set . RetainAll ( c ) ;
231
+ return internalSet . RetainAll ( c ) ;
232
232
}
233
233
234
234
public Iesi . Collections . ISet Union ( Iesi . Collections . ISet a )
235
235
{
236
236
Read ( ) ;
237
- return _set . Union ( a ) ;
237
+ return internalSet . Union ( a ) ;
238
238
}
239
239
240
240
#endregion
241
241
242
- // /// <summary>
243
- // /// <see cref="IDictionary.IsFixedSize"/>
244
- // /// </summary>
245
- // public bool IsFixedSize
246
- // {
247
- // get { return false; }
248
- // }
249
- //
250
- // /// <summary>
251
- // /// <see cref="IDictionary.IsReadOnly"/>
252
- // /// </summary>
253
- // public bool IsReadOnly
254
- // {
255
- // get { return false; }
256
- // }
257
-
258
242
#region System.Collections.IEnumerable Members
259
243
260
244
/// <summary>
@@ -263,7 +247,7 @@ public Iesi.Collections.ISet Union(Iesi.Collections.ISet a)
263
247
public override IEnumerator GetEnumerator ( )
264
248
{
265
249
Read ( ) ;
266
- return _set . GetEnumerator ( ) ;
250
+ return internalSet . GetEnumerator ( ) ;
267
251
}
268
252
269
253
#endregion
@@ -274,7 +258,7 @@ public override IEnumerator GetEnumerator()
274
258
public object Clone ( )
275
259
{
276
260
Read ( ) ;
277
- return _set . Clone ( ) ;
261
+ return internalSet . Clone ( ) ;
278
262
}
279
263
280
264
#endregion
@@ -284,21 +268,21 @@ public object Clone()
284
268
/// </summary>
285
269
public override ICollection Elements ( )
286
270
{
287
- return _set ;
271
+ return internalSet ;
288
272
}
289
273
290
274
/// <summary>
291
275
/// <see cref="PersistentCollection.Empty"/>
292
276
/// </summary>
293
277
public override bool Empty
294
278
{
295
- get { return _set . Count == 0 ; }
279
+ get { return internalSet . Count == 0 ; }
296
280
}
297
281
298
282
public override string ToString ( )
299
283
{
300
284
Read ( ) ;
301
- return _set . ToString ( ) ;
285
+ return internalSet . ToString ( ) ;
302
286
}
303
287
304
288
@@ -307,7 +291,7 @@ public override string ToString()
307
291
/// </summary>
308
292
public override void WriteTo ( IDbCommand st , CollectionPersister persister , object entry , int i , bool writeOrder )
309
293
{
310
- persister . WriteElement ( st , entry , writeOrder , session ) ;
294
+ persister . WriteElement ( st , entry , writeOrder , session ) ;
311
295
}
312
296
313
297
/// <summary>
@@ -341,7 +325,7 @@ public override void EndRead(CollectionPersister persister, object owner)
341
325
foreach ( object identifier in tempIdentifierList )
342
326
{
343
327
object element = persister . ElementType . ResolveIdentifier ( identifier , session , owner ) ;
344
- _set . Add ( element ) ;
328
+ internalSet . Add ( element ) ;
345
329
}
346
330
347
331
}
@@ -351,7 +335,7 @@ public override void EndRead(CollectionPersister persister, object owner)
351
335
/// </summary>
352
336
public override ICollection Entries ( )
353
337
{
354
- return _set ;
338
+ return internalSet ;
355
339
}
356
340
357
341
@@ -360,10 +344,10 @@ public override ICollection Entries()
360
344
/// </summary>
361
345
public override object Disassemble ( CollectionPersister persister )
362
346
{
363
- object [ ] result = new object [ _set . Count ] ;
347
+ object [ ] result = new object [ internalSet . Count ] ;
364
348
int i = 0 ;
365
349
366
- foreach ( object obj in _set )
350
+ foreach ( object obj in internalSet )
367
351
{
368
352
result [ i ++ ] = persister . ElementType . Disassemble ( obj , session ) ;
369
353
}
@@ -382,14 +366,14 @@ public override ICollection GetDeletes(IType elemType)
382
366
{
383
367
object test = e . Key ;
384
368
385
- if ( _set . Contains ( test ) == false )
369
+ if ( internalSet . Contains ( test ) == false )
386
370
{
387
371
deletes . Add ( test ) ;
388
372
}
389
373
390
374
}
391
375
392
- foreach ( object obj in _set )
376
+ foreach ( object obj in internalSet )
393
377
{
394
378
//object testKey = e.Key;
395
379
object oldKey = snapshot [ obj ] ;
0 commit comments