Changeset 355 for trunk/Include/Classes/System/Collections/ArrayList.ab
- Timestamp:
- Oct 13, 2007, 2:11:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Collections/ArrayList.ab
r309 r355 2 2 3 3 #require <Classes/System/Collections/misc.ab> 4 5 Namespace System 6 Namespace Collections 4 7 5 8 Class ArrayList … … 351 354 End Class 352 355 353 /* 354 Class ArrayList_Element 355 Public 356 Sub ArrayList_Element() 357 Init(0) 358 End Sub 359 Sub ArrayList_Element(c As Long) 360 Init(c) 361 End Sub 362 363 Sub ~ArrayList_Element() 364 free(Elm) 365 End Sub 366 367 Sub Init(c As Long) 368 If c > 0 Then 369 Elm = malloc(SizeOf (*Object) * c) 370 If Elm = 0 Then 371 ' OutOfMemoryException 372 Debug 373 End If 374 Else 375 Elm = 0 376 End If 377 Size = 0 378 Capacity = c 379 End Sub 380 381 Sub Swap(ByRef x As ArrayList_Element) 382 Dim tmpElm = x.Elm 383 x.Elm = This.Elm 384 This.Elm = tmpElm 385 386 Dim tmpSize = x.Size 387 x.Size = This.Size 388 This.Size = x.Size 389 390 Dim tmpCap = x.Capacity 391 x.Capacity = This.Capacity 392 This.Capacity = tmpCap 393 End Sub 394 395 Elm As **Object 396 Size As Long 397 Capacity As Long 398 End Class 399 */ 356 End Namespace 'Collections 357 End Namespace 'System
Note:
See TracChangeset
for help on using the changeset viewer.