Changeset 631 for trunk/ab5.0
- Timestamp:
- Sep 22, 2008, 5:31:01 AM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/System/Collections
- Files:
-
- 4 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 -
trunk/ab5.0/ablib/src/Classes/System/Collections/ObjectModel/ReadOnlyCollection.ab
r619 r631 6 6 7 7 Class ReadOnlyCollection<T> 8 Implements Generic.IList<T>9 list As Generic.IList<T>8 Implements System.Collections.Generic.IList<T> 9 list As System.Collections.Generic.IList<T> 10 10 11 11 Public 12 12 'Collection クラスの新しいインスタンスを初期化します。 13 13 Sub ReadOnlyCollection () 14 This.list = New Generic.List<T> 14 Dim l = New System.Collections.Generic.List<T> 15 This.list = l 15 16 End Sub 16 Sub ReadOnlyCollection ( list As Generic.IList<T> )17 Sub ReadOnlyCollection ( list As System.Collections.Generic.IList<T> ) 17 18 This.list = list 18 19 End Sub … … 35 36 'Collection をラップする IList ラッパーを取得します。 36 37 Function Items () As Generic.IList<T> 37 Return list38 Return This 38 39 End Function 39 40 … … 57 58 58 59 'Collection を反復処理する列挙子を返します。 59 Override Function GetEnumerator () As Generic.IEnumerator<T>60 Override Function GetEnumerator () As System.Collections.Generic.IEnumerator<T> 60 61 Return This.list.GetEnumerator() 61 62 End Function
Note:
See TracChangeset
for help on using the changeset viewer.