- Timestamp:
- Jan 13, 2009, 1:57:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab
r633 r675 56 56 End Sub 57 57 58 Sub SetLeastCapacity( capacity As Long ) 59 If This.capacity < capacity Then 60 Realloc(capacity) 61 End If 58 Sub SetLeastCapacity( leastCapacity As Long ) 59 Dim c = This.capacity 60 While c < leastCapacity 61 c *= 2 62 Wend 63 Realloc(c) 62 64 End Sub 63 65 Public … … 91 93 92 94 /*! 93 @brief 既存のIEnumera tor<T>を使用してListを初期化95 @brief 既存のIEnumerable<T>を使用してListを初期化 94 96 @author NoWest 95 97 @date 2008/09/22 96 @param 基になるIEnumera tor<T>97 */ 98 Sub List ( enumera tor As IEnumerator<T> )98 @param 基になるIEnumerable<T> 99 */ 100 Sub List ( enumerable As IEnumerable<T> ) 99 101 _Initialize( 1 ) 100 While enumerator.MoveNext()101 'ここでTをByetに変換できないというエラーになる This.Add(enumerator.Current())102 Wend102 Foreach e In enumerable 103 ' This.Add(e) 104 Next 103 105 End Sub 104 106 … … 146 148 End Function 147 149 150 /*! 151 @brief 内部の配列へのポインタを取得する 152 @auther Egtra 153 @date 2009/01/13 154 @retrun 内部の配列へのポインタ 155 @pre Count <> 0 156 */ 157 Function Data() As *T 158 Return items 159 End Function 148 160 149 161 '---------------------------------------------------------------- … … 217 229 End Sub 218 230 219 /* Override Function Contains ( item As T ) As Boolean 220 TODO 221 End Function*/ 231 /*! 232 @brief Listに指定された要素が含まれるか調べる 233 @author Egtra 234 @date 2009/01/13 235 */ 236 Function Contains ( item As T ) As Boolean 237 Return IndexOf(item) >= 0 238 End Function 222 239 223 240 /*!
Note:
See TracChangeset
for help on using the changeset viewer.