<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGenerics%2FGeneric_Stack</id>
		<title>VB.Net Tutorial/Generics/Generic Stack - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGenerics%2FGeneric_Stack"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Generics/Generic_Stack&amp;action=history"/>
		<updated>2026-04-05T07:44:09Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Generics/Generic_Stack&amp;diff=3746&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Generics/Generic_Stack&amp;diff=3746&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Generics/Generic_Stack&amp;diff=3747&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Generics/Generic_Stack&amp;diff=3747&amp;oldid=prev"/>
				<updated>2010-05-26T12:56:33Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Generic Stack==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Module StackTest&lt;br /&gt;
   Dim doubleElements() As Double = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6}&lt;br /&gt;
   Dim integerElements() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}&lt;br /&gt;
   Dim doubleStack As Stack(Of Double)&lt;br /&gt;
   Dim integerStack As Stack(Of Integer)&lt;br /&gt;
   Sub Main()&lt;br /&gt;
      doubleStack = New Stack(Of Double)(5)&lt;br /&gt;
      integerStack = New Stack(Of Integer)(10)&lt;br /&gt;
      TestPushDouble()&lt;br /&gt;
      TestPopDouble() &lt;br /&gt;
      TestPushInteger()&lt;br /&gt;
      TestPopInteger() &lt;br /&gt;
   End Sub &lt;br /&gt;
   Sub TestPushDouble()&lt;br /&gt;
      Try&lt;br /&gt;
         Console.WriteLine(&amp;quot;Pushing elements onto doubleStack&amp;quot;)&lt;br /&gt;
         For Each element As Double In doubleElements&lt;br /&gt;
            Console.Write(&amp;quot;{0:F1} &amp;quot;, element)&lt;br /&gt;
            doubleStack.Push(element)&lt;br /&gt;
         Next element&lt;br /&gt;
      Catch exception As GenericStackException&lt;br /&gt;
         Console.Error.WriteLine(&amp;quot;Message: &amp;quot; &amp;amp; exception.Message)&lt;br /&gt;
         Console.Error.WriteLine(exception.StackTrace)&lt;br /&gt;
      End Try&lt;br /&gt;
   End Sub&lt;br /&gt;
   Sub TestPopDouble()&lt;br /&gt;
      Try&lt;br /&gt;
         Console.WriteLine(&amp;quot;Popping elements from doubleStack&amp;quot;)&lt;br /&gt;
         Dim popValue As Double&lt;br /&gt;
         While True&lt;br /&gt;
            popValue = doubleStack.Pop()&lt;br /&gt;
            Console.Write(&amp;quot;{0:F1} &amp;quot;, popValue)&lt;br /&gt;
         End While&lt;br /&gt;
      Catch exception As GenericStackException&lt;br /&gt;
         Console.Error.WriteLine()&lt;br /&gt;
         Console.Error.WriteLine(&amp;quot;Message: &amp;quot; &amp;amp; exception.Message)&lt;br /&gt;
         Console.Error.WriteLine(exception.StackTrace)&lt;br /&gt;
      End Try&lt;br /&gt;
   End Sub&lt;br /&gt;
   Sub TestPushInteger()&lt;br /&gt;
      Try&lt;br /&gt;
         Console.WriteLine(&amp;quot;Pushing elements onto integerStack&amp;quot;)&lt;br /&gt;
         For Each element As Integer In integerElements&lt;br /&gt;
            Console.Write(&amp;quot;{0} &amp;quot;, element)&lt;br /&gt;
            integerStack.Push(element) &amp;quot; push onto integerStack&lt;br /&gt;
         Next element&lt;br /&gt;
      Catch exception As GenericStackException&lt;br /&gt;
         Console.Error.WriteLine()&lt;br /&gt;
         Console.Error.WriteLine(&amp;quot;Message: &amp;quot; &amp;amp; exception.Message)&lt;br /&gt;
         Console.Error.WriteLine(exception.StackTrace)&lt;br /&gt;
      End Try&lt;br /&gt;
   End Sub&lt;br /&gt;
   &lt;br /&gt;
   Sub TestPopInteger()&lt;br /&gt;
      Try&lt;br /&gt;
         Console.WriteLine(&amp;quot;Popping elements from integerStack&amp;quot;)&lt;br /&gt;
         Dim popValue As Integer&lt;br /&gt;
         While True&lt;br /&gt;
            popValue = integerStack.Pop()&lt;br /&gt;
            Console.Write(&amp;quot;{0} &amp;quot;, popValue)&lt;br /&gt;
         End While&lt;br /&gt;
      Catch exception As GenericStackException&lt;br /&gt;
         Console.Error.WriteLine()&lt;br /&gt;
         Console.Error.WriteLine(&amp;quot;Message: &amp;quot; &amp;amp; exception.Message)&lt;br /&gt;
         Console.Error.WriteLine(exception.StackTrace)&lt;br /&gt;
      End Try&lt;br /&gt;
   End Sub&lt;br /&gt;
End Module&lt;br /&gt;
Public Class Stack(Of E)&lt;br /&gt;
   Private top As Integer&lt;br /&gt;
   Private elements() As E&lt;br /&gt;
   Public Sub New()&lt;br /&gt;
      MyClass.New(10)&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   Public Sub New(ByVal stackSize As Integer)&lt;br /&gt;
      If stackSize &amp;gt; 0 Then &lt;br /&gt;
         elements = New E(stackSize - 1) {}&lt;br /&gt;
      Else&lt;br /&gt;
         elements = New E(9) {}&lt;br /&gt;
      End If&lt;br /&gt;
      top = -1&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   Public Sub Push(ByVal pushValue As E)&lt;br /&gt;
      If top = elements.Length - 1 Then&lt;br /&gt;
         Throw New GenericStackException(String.Format(&amp;quot;Stack is full, cannot push {0}&amp;quot;, pushValue))&lt;br /&gt;
      End If&lt;br /&gt;
      top += 1&lt;br /&gt;
      elements(top) = pushValue &lt;br /&gt;
   End Sub&lt;br /&gt;
   Public Function Pop() As E&lt;br /&gt;
      If top = -1 Then&lt;br /&gt;
         Throw New GenericStackException(&amp;quot;Stack is empty, cannot pop&amp;quot;)&lt;br /&gt;
      End If&lt;br /&gt;
      top -= 1&lt;br /&gt;
      Return elements(top + 1) &lt;br /&gt;
   End Function &lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class GenericStackException : Inherits ApplicationException&lt;br /&gt;
   Public Sub New()&lt;br /&gt;
      MyBase.New(&amp;quot;Stack is empty&amp;quot;)&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   Public Sub New(ByVal exception As String)&lt;br /&gt;
      MyBase.New(exception)&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Pushing elements onto doubleStack&lt;br /&gt;
1.1 2.2 3.3 4.4 5.5 6.6 Message: Stack is full, cannot push 6.6&lt;br /&gt;
   at Stack`1.Push(E pushValue)&lt;br /&gt;
   at StackTest.TestPushDouble()&lt;br /&gt;
Popping elements from doubleStack&lt;br /&gt;
5.5 4.4 3.3 2.2 1.1&lt;br /&gt;
Message: Stack is empty, cannot pop&lt;br /&gt;
   at Stack`1.Pop()&lt;br /&gt;
   at StackTest.TestPopDouble()&lt;br /&gt;
Pushing elements onto integerStack&lt;br /&gt;
1 2 3 4 5 6 7 8 9 10 11&lt;br /&gt;
Message: Stack is full, cannot push 11&lt;br /&gt;
   at Stack`1.Push(E pushValue)&lt;br /&gt;
   at StackTest.TestPushInteger()&lt;br /&gt;
Popping elements from integerStack&lt;br /&gt;
10 9 8 7 6 5 4 3 2 1&lt;br /&gt;
Message: Stack is empty, cannot pop&lt;br /&gt;
   at Stack`1.Pop()&lt;br /&gt;
   at StackTest.TestPopInteger()&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>