Changeset 631 for trunk/ab5.0/ablib/src/Classes/System/Collections/Generic
- Timestamp:
- Sep 22, 2008, 5:31:01 AM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/System/Collections/Generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab
r592 r631 80 80 @author NoWest 81 81 @date 2008/07/13 82 @param インデックス 82 @param 基になる配列へのポインタ 83 @param 配列の長さ 83 84 */ 84 85 Sub List( array As *T, length As Long ) … … 87 88 memmove( This.items, array, length * SizeOf(T) ) 88 89 This.count = length 90 End Sub 91 92 /*! 93 @brief 既存のIEnumerator<T>使用してListを初期化 94 @author NoWest 95 @date 2008/09/22 96 @param 基になるIEnumerator<T> 97 */ 98 Sub List ( enumerator As IEnumerator<T> ) 99 _Initialize( 1 ) 100 While enumerator.MoveNext() 101 'This.Add(enumerator.Current()) 102 Wend 89 103 End Sub 90 104 … … 185 199 End Sub 186 200 187 ' Function AsReadOnly() As ReadOnlyCollection 201 /*! 202 @brief 読み取り専用のListのラッパーを取得 203 @author NoWest 204 @date 2008/09/22 205 */ 206 Function AsReadOnly() As System.Collections.ObjectModel.ReadOnlyCollection<T> 207 Return New System.Collections.ObjectModel.ReadOnlyCollection<T>(This) 208 End Function 188 209 189 210 /*! -
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Queue.ab
r607 r631 15 15 End Sub 16 16 17 Sub initialize() 18 This.items = GC_malloc(1) 19 End Sub 20 17 21 Public 18 22 Sub Queue () 19 This.i tems = GC_malloc( 1)23 This.initialize() 20 24 End Sub 21 25 22 26 Sub Queue ( capacity As Long ) 23 This.i tems = GC_malloc( 1)27 This.initialize() 24 28 If capacity > 0 Then 25 29 This.size = capacity 26 30 Realloc(capacity) 27 31 End If 32 End Sub 33 34 Sub Queue ( enumerator As IEnumerator<T> ) 35 This.initialize() 36 While enumerator.MoveNext() 37 This.Enqueue(enumerator.Current()) 38 Wend 28 39 End Sub 29 40 -
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab
r607 r631 15 15 End Sub 16 16 17 Sub initialize() 18 This.items = GC_malloc(1) 19 End Sub 17 20 Public 18 21 Sub Stack () 19 This.i tems = GC_malloc( 1)22 This.initialize() 20 23 End Sub 21 24 22 25 Sub Stack ( capacity As Long ) 23 This.i tems = GC_malloc( 1)26 This.initialize() 24 27 If capacity > 0 Then 25 28 This.size = capacity 26 29 Realloc(capacity) 27 30 End If 31 End Sub 32 33 Sub Stack ( enumerator As IEnumerator<T> ) 34 This.initialize() 35 While enumerator.MoveNext() 36 This.Push(enumerator.Current()) 37 Wend 28 38 End Sub 29 39
Note:
See TracChangeset
for help on using the changeset viewer.