Changeset 386 for trunk/Include/Classes/System/Collections
- Timestamp:
- Nov 23, 2007, 11:39:44 AM (17 years ago)
- Location:
- trunk/Include/Classes/System/Collections
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Collections/ArrayList.ab
r381 r386 7 7 8 8 Class ArrayList 9 Implements IList /*, ICollection, IEnumerable, ICloneable*/9 'Implements IList /*, ICollection, IEnumerable, ICloneable*/ 10 10 11 11 pObject As *Object … … 76 76 End Function 77 77 78 /*Const*/ OverrideFunction IsFixedSize() As Boolean78 /*Const*/ Function IsFixedSize() As Boolean 79 79 Return False 80 80 End Function 81 81 82 /*Const*/ OverrideFunction IsReadOnly() As Boolean82 /*Const*/ Function IsReadOnly() As Boolean 83 83 Return False 84 84 End Function … … 219 219 End Function 220 220 221 /*Const*/ OverrideFunction IndexOf(object As Object) As Long221 /*Const*/ Function IndexOf(object As Object) As Long 222 222 Return IndexOf(object, 0, size) 223 223 End Function … … 238 238 End Function 239 239 240 OverrideSub Insert(i As Long, object As Object)240 Sub Insert(i As Long, object As Object) 241 241 SetLeastCapacity(size + 1) 242 242 memmove(VarPtr(pObject[i + 1]), VarPtr(pObject[i]), SizeOf (*Object) * (size - i)) … … 261 261 End Function 262 262 263 OverrideSub Remove(object As Object)263 Sub Remove(object As Object) 264 264 Dim i = IndexOf(object) 265 265 If i > 0 Then … … 268 268 End Sub 269 269 270 OverrideSub RemoveAt(i As Long)270 Sub RemoveAt(i As Long) 271 271 RemoveRange(i, 1) 272 272 End Sub … … 307 307 End Sub 308 308 309 /*Override*/Override Function ToString() As String309 Override Function ToString() As String 310 310 Return "System.Collections.ArrayList" 311 311 End Function -
trunk/Include/Classes/System/Collections/Generic/List.ab
r352 r386 5 5 6 6 Class List<T> 7 Implements IEnumerable, IEnumerator 7 8 items As *T 8 9 size As Long 10 11 currentIndexForEnumerator As Long 9 12 10 13 Sub Realloc( allocateSize As Long ) … … 125 128 size-- 126 129 End Sub 130 131 /*! 132 @brief IEnumeratorインターフェイスを取得する 133 @author Daisuke Yamamoto 134 @date 2007/11/19 135 @return IEnumeratorインターフェイスが返る 136 */ 137 Function GetEnumerator() As IEnumerator 138 Return This 139 End Function 140 141 /*! 142 @brief イテレータのカレントインデックスを増加させる 143 @author Daisuke Yamamoto 144 @date 2007/11/19 145 @return 上限に達していなければTrueが、達していればFalseが返る 146 */ 147 Function MoveNext() As Boolean 148 If currentIndexForEnumerator >= size Then 149 ' 上限に達した 150 Return False 151 End If 152 153 currentIndexForEnumerator ++ 154 Return True 155 End Function 156 157 /*! 158 @brief イテレータをリセットする 159 @author Daisuke Yamamoto 160 @date 2007/11/19 161 */ 162 Sub Reset() 163 currentIndexForEnumerator = 0 164 End Sub 165 166 /*! 167 @brief イテレータのカレントオブジェクトを取得する 168 @author Daisuke Yamamoto 169 @date 2007/11/19 170 @return カレントオブジェクトが返る 171 */ 172 Function Current() As Object 173 Return items[currentIndexForEnumerator] As Object 174 End Function 127 175 End Class 128 176 -
trunk/Include/Classes/System/Collections/misc.ab
r355 r386 49 49 Interface IEnumerable 50 50 ' Method 51 ' Function GetEnumerator() As *IEnumerator51 Function GetEnumerator() As IEnumerator 52 52 End Interface 53 53 … … 57 57 Sub Reset() 58 58 ' Property 59 Function Current() As *Object59 Function Current() As Object 60 60 End Interface 61 61
Note:
See TracChangeset
for help on using the changeset viewer.