- Timestamp:
- Aug 8, 2008, 12:15:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab
r577 r579 18 18 Sub Stack () 19 19 This.items = GC_malloc( 1 ) 20 Reset()21 20 End Sub 22 21 23 22 Sub Stack ( capacity As Long ) 24 23 This.items = GC_malloc( 1 ) 25 Reset()26 24 If capacity > 0 Then 27 25 This.size = capacity … … 64 62 */ 65 63 Override Function GetEnumerator () As IEnumerator<T> 66 Return This64 Return New Detail.PointerEnumerator(items, count) 67 65 End Function 68 66 … … 117 115 End If 118 116 End Sub 119 120 121 '------------------------122 ' IEnumeratorの実装123 '------------------------124 currentIndexForEnumerator As Long125 126 Override Function Current () As T127 If This.currentIndexForEnumerator = -1 Then128 ' MoveNextメソッドがReset後、一度も呼び出されなかった129 Return Nothing130 End If131 Return This.items[ This.currentIndexForEnumerator ]132 End Function133 134 Override Function MoveNext() As Boolean135 If This.currentIndexForEnumerator + 1 >= This.count Then136 ' 上限に達した137 Return False138 End If139 140 This.currentIndexForEnumerator ++141 Return True142 End Function143 144 Override Sub Reset ()145 This.currentIndexForEnumerator = -1146 End Sub147 117 End Class 148 118
Note:
See TracChangeset
for help on using the changeset viewer.