Index: trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab	(revision 553)
+++ trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab	(revision 557)
@@ -3,48 +3,4 @@
 Namespace Collections
 Namespace Generic
-
-Interface IEnumerable<T>
-	' Method
-	Function GetEnumerator() As IEnumerator<T>
-End Interface
-
-Interface IEnumerator<T>
-	' Methods
-	Function MoveNext() As Boolean
-	Sub Reset()
-	' Property
-	Function Current() As T
-End Interface
-
-
-Class ICollection<T>
-	Implements IEnumerable<T>, IEnumerator<T>
-Public
-	' Property
-	Abstract Function Count() As Long
-	Abstract Function IsReadOnly() As Boolean
-
-	' Methods
-	Abstract Sub Add( item As T )
-	Abstract Sub Clear()
-'	Abstract Function Contains ( item As T ) As Boolean
-'	Abstract Sub CopyTo (ByRef array As List<T>, arrayIndex As Long )
-	Abstract Function Remove( item As T ) As Boolean
-End Class
-
-
-Class IList<T>
-	Inherits ICollection<T>
-Public
-	' Property
-	Abstract Sub Operator[] ( index As Long, item As T )
-	Abstract Function Operator[] ( index As Long ) As T
-	' Methods
-'	Abstract Function Item ( index As Long ) As T
-	Abstract Function IndexOf( item As T ) As Long
-	Abstract Sub Insert( index As Long, item As T )
-	Abstract Sub RemoveAt( index As Long )
-End Class
-
 
 Class List<T>
Index: trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab	(revision 557)
+++ trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab	(revision 557)
@@ -0,0 +1,148 @@
+
+Namespace System
+Namespace Collections
+Namespace Generic
+
+Class Stack<T>
+	Inherits ICollection
+
+	items As *T
+	size As Long
+	count As Long
+
+	Sub Realloc ( allocateSize As Long )
+		This.items = realloc( This.items, allocateSize * SizeOf(T) )
+	End Sub
+
+Public
+	Sub Stack ()
+		This.items = GC_malloc( 1 )
+		Reset()
+	End Sub
+
+	Sub Stack ( capacity As Long )
+		Stack()
+		If capacity > 0 Then
+			This.size = capacity
+			Realloc(capacity)
+		End If
+	End Sub
+
+	/*!
+	@brief	Stackに格納されている要素の数を取得
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Override Function Count () As Long
+		Return This.count
+	End Function
+
+Public
+	/*!
+	@brief	Stackからすべての要素を削除する
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Override Sub Clear ()
+		This.count = 0
+	End Sub
+
+	'ある要素が Stack 内に存在するかどうかを判断
+/*	Override Function Contains ( item As T ) As Boolean
+		TODO
+	End Function*/
+
+	'既存の 1 次元の Array に Stack をコピーします。コピー操作は、配列の指定したインデックスから始まります。 
+/*	CopyTo*/
+
+	/*!
+	@brief	IEnumeratorインターフェイスを取得する
+	@author	NoWest
+	@date	2008/07/20
+	@return	IEnumeratorインターフェイス
+	*/
+	Override Function GetEnumerator () As IEnumerator<T>
+		Return This
+	End Function
+
+	/*!
+	@brief	Stackの先頭にあるオブジェクトを削除せずに返します
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Function Peek () As T
+		Peek = This.items[ This.count -1 ]
+	End Function
+
+ 	/*!
+	@brief	Stackの先頭にあるオブジェクトを削除し、返します
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Function Pop () As T
+		Pop = This.items[ This.count -1 ]
+		This.count--
+	End Function
+
+	/*!
+	@brief	Stackの先頭にオブジェクトを挿入します
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Sub Push ( item As T )
+		This.count++
+		If This.size < This.count Then
+			This.size++
+			Realloc( This.size )
+		End If
+		This.items[ This.count -1 ] = item
+	End Sub
+
+	'Stack を新しい配列にコピーします。 
+/*	ToArray*/
+
+	/*!
+	@brief	実際の要素数が現在の容量の 90% 未満の場合は、容量をその数に設定します
+	@author	NoWest
+	@date	2008/07/20
+	*/
+	Sub TrimExcess ()
+		Dim pmemobj = _System_pGC->GetMemoryObjectPtr( items )
+		If ( This.size ) * 0.9 > This.count Then
+			This.size = This.count
+			Realloc( This.size )
+		End If
+	End Sub
+
+
+	'------------------------
+	'	IEnumeratorの実装
+	'------------------------
+	currentIndexForEnumerator As Long
+
+	Override Function Current () As T
+		If This.currentIndexForEnumerator = -1 Then
+			' MoveNextメソッドがReset後、一度も呼び出されなかった
+			Return Nothing
+		End If
+		Return This.items[ This.currentIndexForEnumerator ]
+	End Function
+
+	Override Function MoveNext() As Boolean
+		If This.currentIndexForEnumerator + 1 >= This.count Then
+			' 上限に達した
+			Return False
+		End If
+
+		This.currentIndexForEnumerator ++
+		Return True
+	End Function
+
+	Override Sub Reset ()
+		This.currentIndexForEnumerator = -1
+	End Sub
+End Class
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/misc.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/misc.ab	(revision 557)
+++ trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/misc.ab	(revision 557)
@@ -0,0 +1,64 @@
+
+Namespace System
+Namespace Collections
+Namespace Generic
+
+Interface IEnumerable<T>
+	' Method
+	Function GetEnumerator () As IEnumerator<T>
+End Interface
+
+Interface IEnumerator<T>
+	' Methods
+	Function MoveNext () As Boolean
+	Sub Reset()
+	' Property
+	Function Current () As T
+End Interface
+
+
+Class ICollection<T>
+	Implements IEnumerable<T>, IEnumerator<T>
+Public
+	' Property
+	Virtual Function Count() As Long
+	End Function
+	Virtual Function IsReadOnly() As Boolean
+	End Function
+
+	' Methods
+	Virtual Sub Add ( item As T )
+	End Sub
+	Virtual Sub Clear ()
+	End Sub
+	Virtual  Function Contains ( item As T ) As Boolean
+	End Function
+	Virtual Sub CopyTo (ByRef array As List<T>, arrayIndex As Long )
+	End Sub
+	Virtual Function Remove ( item As T ) As Boolean
+	End Function
+End Class
+
+
+Class IList<T>
+	Inherits ICollection<T>
+Public
+	' Property
+	Virtual Sub Operator[] ( index As Long, item As T )
+	End Sub
+	Virtual Function Operator[] ( index As Long ) As T
+	End Function
+	' Methods
+	Virtual Function Item ( index As Long ) As T
+	End Function
+	Virtual Function IndexOf ( item As T ) As Long
+	End Function
+	Virtual Sub Insert ( index As Long, item As T )
+	End Sub
+	Virtual Sub RemoveAt( index As Long )
+	End Sub
+End Class
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/ab5.0/ablib/src/Classes/index.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/index.ab	(revision 553)
+++ trunk/ab5.0/ablib/src/Classes/index.ab	(revision 557)
@@ -27,6 +27,8 @@
 #require "./System/Collections/ArrayList.ab"
 #require "./System/Collections/misc.ab"
+#require "./System/Collections/Generic/misc.ab"
 #require "./System/Collections/Generic/Dictionary.ab"
 #require "./System/Collections/Generic/List.ab"
+#require "./System/Collections/Generic/Stack.ab"
 #require "./System/Collections/Generic/KeyNotFoundException.ab"
 /*
