Changeset 188
- Timestamp:
- Mar 28, 2007, 5:10:35 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Collections/ArrayList.ab
r118 r188 62 62 ' Methods 63 63 ' Constractors 64 Sub Arr rayList()65 data. ArrayList(16)64 Sub ArrayList() 65 data.Init(16) 66 66 End Sub 67 67 /* … … 72 72 */ 73 73 Sub ArrayList(c As Long) 74 data. ArrayList_Element(c)74 data.Init(c) 75 75 End Sub 76 76 … … 88 88 End Function 89 89 90 /*Override*/ Virtual Function Add(x As Object) As Long 91 setLeastCapacity(data.Size + 1) 92 data.Elm[data.Size] = VarPtr(x) 93 Add = data.Size 94 data.Size++ 95 End Function 96 90 97 Virtual Sub AddRange(ByRef c As ICollection) 91 98 ' TODO: 実装 … … 109 116 110 117 Virtual Function Clone() As *ArrayList 111 Dim p = New ArrayList(data.Size) 118 Dim p As *ArrayList 119 p = New ArrayList(data.Size) 112 120 p->data.Size = data.Size 113 121 memcpy(p->data.Elm, This.data.Elm, SizeOf (*Object) * data.Size) … … 115 123 End Function 116 124 117 /*Const*/ /*Override*/ Virtual Function Contains(x As *Object) As Boolean125 /*Const*/ /*Override*/ /*Virtual Function Contains(x As *Object) As Boolean 118 126 Dim i As Long 119 127 For i = 0 To ELM(data.Size) … … 122 130 End If 123 131 Next 124 End Function 132 End Function*/ 125 133 126 134 ' CopyTo 127 135 /*Const*/ /*Override*/ Virtual Function GetEnumerator() As *IEnumerator 128 Return GetEnumerator(index, count)136 'Return GetEnumerator(index, count) 129 137 End Function 130 138 … … 284 292 Class ArrayList_Element 285 293 Public 294 Sub ArrayList_Element() 295 Init(0) 296 End Sub 286 297 Sub ArrayList_Element(c As Long) 298 Init(c) 299 End Sub 300 301 Sub ~ArrayList_Element() 302 free(Elm) 303 End Sub 304 305 Sub Init(c As Long) 287 306 If c > 0 Then 288 307 Elm = malloc(SizeOf (*Object) * c) … … 298 317 End Sub 299 318 300 Sub ~ArrayList_Element()301 free(Elm)302 End Sub303 304 319 Sub Swap(ByRef x As ArrayList_Element) 305 320 Dim tmpElm = x.Elm
Note:
See TracChangeset
for help on using the changeset viewer.