示例#1
0
        static void Main(string[] args)
        {
            ConcretedAggregate bus = new ConcretedAggregate();//公交车

            for (int i = 0; i < 10; i++)
            {
                bus[i] = "甲";
            }

            Iterator conductor = new ConcretedIterator(bus); //售票员

            object item = conductor.First();

            while (!conductor.IsDown()) //一个一个收票
            {
                Console.WriteLine(item);
                conductor.Next();
            }

            string temp = "1.1.1.1";

            Console.WriteLine(temp.Replace(".", "[.]"));
        }
示例#2
0
 /// <inheritdoc />
 public ConcretedIterator(ConcretedAggregate concretedAggregate)
 {
     this.concretedAggregate = concretedAggregate;
 }
示例#3
0
 /// <inheritdoc />
 public ConcreteItertatorDesc(ConcretedAggregate concretedAggregate)
 {
     this.concretedAggregate = concretedAggregate;
     this.count = concretedAggregate.Count;
 }