Changeset 203 for Include/Classes/System/Collections/ArrayList.ab
- Timestamp:
- Apr 4, 2007, 6:53:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Collections/ArrayList.ab
r195 r203 37 37 Debug 38 38 End If 39 capacity = size 39 40 End Sub 40 41 … … 42 43 If This.capacity < capacity Then 43 44 This.capacity = capacity 44 Realloc( capacity)45 Realloc(capacity) 45 46 End If 46 47 End Sub … … 96 97 /*Override*/ Virtual Sub Operator []=(index As Long, object As Object) 97 98 If 0 <= index And index < size Then 98 pObject[i ] = object99 pObject[index] = object 99 100 Else 100 101 'Throw OutOfRangeException? … … 114 115 End Sub 115 116 /* 116 Sub ArrayList( ByRefc As ICollection)117 Sub ArrayList(c As ICollection) 117 118 ' 未実装 118 119 Debug … … 127 128 End Sub 128 129 129 ' Sub Operator =( ByRefa As ArrayList)130 ' Sub Operator =(a As ArrayList) 130 131 131 132 /*Override*/ Virtual Function Add( object As Object ) As Long … … 136 137 End Function 137 138 138 Virtual Sub AddRange(ByRef c As ICollection) 139 ' TODO: 実装 140 End Sub 141 142 Const Virtual Function BinarySearch(x As *Object) 143 ' TODO: 実装 144 End Function 145 146 Const Virtual Function BinarySearch(x As *Object, ByRef c As IComparer) As Long 147 ' TODO: 実装 148 End Function 149 150 Const Virtual Function BinarySearch(index As Long, count As Long, x As *Object, ByRef c As IComparer) As Long 151 ' TODO: 実装 139 Virtual Sub AddRange(c As ICollection) 140 ' TODO: 実装 141 End Sub 142 143 Const Virtual Function BinarySearch(x As Object) 144 ' TODO: 実装 145 End Function 146 147 Const Virtual Function BinarySearch(x As Object, c As IComparer) As Long 148 Return BinarySearch(0, size, x, c) 149 End Function 150 151 Const Virtual Function BinarySearch(index As Long, count As Long, x As Object, c As IComparer) As Long 152 Dim l = index 153 Dim r = index + ELM(count) 154 While l <= r 155 Dim mid = (l + r) >> 2 156 Dim ret = c.Compare(pObject[mid], x) 157 If ret = 0 Then 158 Return mid 159 Else If ret < 0 Then 'pObject[mid] < x 160 If l = r Then 161 If mid + 1 <= index + ELM(count) Then 162 Return Not (mid + 1) 163 Else 164 Return count 165 End If 166 End If 167 l = mid + 1 168 Else 'pObject[mid] > x 169 If l = r And mid + 1 <= index + ELM(count) Then 170 Return Not mid 171 End If 172 r = mid - 1 173 End If 174 Wend 175 If l = index Then 176 Return Not index 177 Else 'r = index + ELM(count) 178 Return Not count 179 End If 152 180 End Function 153 181 … … 172 200 173 201 ' CopyTo 174 /*Const*/ /*Override*/ Virtual Function GetEnumerator() As *IEnumerator 175 'Return GetEnumerator(index, count) 176 End Function 177 178 Const Virtual Function GetEnumerator(index As Long, count As Long) As *IEnumerator 179 ' TODO: 実装 180 End Function 181 182 Virtual Function GetRange(index As Long, count As Long) As *ArrayList 202 203 ' 204 ' /*Const*/ /*Override*/ Virtual Function GetEnumerator() As IEnumerator 205 ' 'Return GetEnumerator(index, count) 206 ' End Function 207 208 ' Const Virtual Function GetEnumerator(index As Long, count As Long) As IEnumerator 209 ' ' TODO: 実装 210 ' End Function 211 212 Virtual Function GetRange(index As Long, count As Long) As ArrayList 183 213 ' TODO: 実装 184 214 End Function … … 210 240 End Sub 211 241 212 Virtual Sub InsertRange(index As Long, ByRefc As ICollection)242 Virtual Sub InsertRange(index As Long, c As ICollection) 213 243 ' TODO: 実装 214 244 End Sub … … 253 283 End Sub 254 284 255 Virtual Sub SetRange(index As Long, ByRefc As ICollection)285 Virtual Sub SetRange(index As Long, c As ICollection) 256 286 ' TODO: 実装 257 287 End Sub … … 261 291 End Sub 262 292 263 Virtual Sub Sort( ByRefc As IComparer)293 Virtual Sub Sort(c As IComparer) 264 294 Sort(0, size, c) 265 295 End Sub 266 296 267 Virtual Sub Sort(index As Long, count As Long, ByRefc As IComparer)297 Virtual Sub Sort(index As Long, count As Long, c As IComparer) 268 298 ' TODO: 実装 269 299 End Sub … … 280 310 ' -------------------------------- 281 311 ' static methods 282 Static Function Adapter( ByRef l As IList) As *ArrayList283 ' TODO: 実装 284 End Function 285 286 Static Function FixedSize( ByRef l As ArrayList) As *ArrayList287 ' TODO: 実装 288 End Function 289 290 Static Function FixedSize( ByRef l As IList) As *IList312 Static Function Adapter(l As IList) As ArrayList 313 ' TODO: 実装 314 End Function 315 316 Static Function FixedSize(l As ArrayList) As ArrayList 317 ' TODO: 実装 318 End Function 319 320 Static Function FixedSize(l As IList) As IList 291 321 Return FixedSize(Adapter(VarPtr(i))) 292 322 End Function 293 323 294 Static Function ReadOnly( ByRef l As ArrayList) As *ArrayList295 ' TODO: 実装 296 End Function 297 298 Static Function ReadOnly( ByRef l As IList) As *IList324 Static Function ReadOnly(l As ArrayList) As ArrayList 325 ' TODO: 実装 326 End Function 327 328 Static Function ReadOnly(l As IList) As IList 299 329 Return ReadOnly(Adapter(VarPtr(i))) 300 330 End Function 301 331 302 Static Function Repeat( ByRef x As Object, c As Long) As *ArrayList332 Static Function Repeat(x As Object, c As Long) As ArrayList 303 333 Repeat = New ArrayList(c) 304 334 Dim i As Long … … 308 338 End Function 309 339 310 Static Function Synchronized( ByRef l As ArrayList) As *ArrayList311 ' TODO: 実装 312 End Function 313 314 Static Function Synchronized( ByRef l As IList) As *IList340 Static Function Synchronized(l As ArrayList) As ArrayList 341 ' TODO: 実装 342 End Function 343 344 Static Function Synchronized(l As IList) As IList 315 345 Return Synchronized(Adapter(VarPtr(i))) 316 346 End Function
Note:
See TracChangeset
for help on using the changeset viewer.