Пример #1
0
        static void Main(string[] args)
        {
            /*Teacher t = new Teacher();
             * IComparable a = (AlumnoProxy)FabricaDeComparables.crearAleatorio(5); //opcion AlumnoProxy
             * Student s = new AdaptadorAlumno((IAlumno)a);
             * t.goToClass(s);
             * t.teachingAClass();*/

            //----- Ejercicio de Examén -----

            Pila p = new Pila();
            Cola c = new Cola();
            ColeccionMultiple cm = new ColeccionMultiple(p, c);

            ColeccionMultipleCompuesto cmc = new ColeccionMultipleCompuesto();

            cmc.agregarHijo(p);
            cmc.agregarHijo(c);
            cmc.agregarHijo(cm);

            Llenar(cmc);
            Informar(cmc);

            Console.WriteLine("Pulse una tecla para continuar...");
            Console.ReadKey();
        }
Пример #2
0
 public IteradorDeColeccionMultiple(Iterable coleccion)
 {
     this.coleccion = (ColeccionMultiple)coleccion;
     this.dePila    = new IteradorDePila(this.coleccion.pila);
     this.deCola    = new IteradorDeCola(this.coleccion.cola);
 }