// // This file contains the C# code from Program 6.5 of // "Data Structures and Algorithms // with Object-Oriented Design Patterns in C#" // by Bruno R. Preiss. // // Copyright (c) 2001--2002 by Bruno R. Preiss, P.Eng. All rights reserved. // // http://www.brpreiss.com/books/opus6/programs/pgm06_05.txt // public class StackAsArray : AbstractContainer, Stack { protected object[] array; public override void Accept(Visitor visitor) { for (int i = 0; i < count; ++i) { visitor.Visit(array[i]); if (visitor.IsDone) return; } } // ... }