因為專業(yè)所以放心

          學(xué)習(xí)是沒有起點和終點的......

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            15 Posts :: 0 Stories :: 1 Comments :: 0 Trackbacks

          Map
          ------------------
          map iim = new map(types::integer, types::class);
          mapIterator it;
          // Add some elements into the list...
          iim.insert(1, new query());
          iim.insert(2, new query());
          iim.insert(4, new query());
          // Create a list iterator
          it = new mapIterator (iim);
          print it.definitionString(); // prints “[int -> class] iterator”
          print it.toString(); // prints “(begin)[(1 -> Query: query object 38824e0)]”
          // Go on for as long as elements are found in the set...
          while (it.more())
          {
          // fetch the next element
          print it.key(); // prints 4 2 1
          print it.value().toString(); // print something like Query object 3881270
          it.next();
          }
          print it.toString();??? // prints (end)
          pause;
          -----------------------------------
          Set
          ------------------
          set s1 = new set (types::integer);
          int theElement;
          setIterator it;
          // Add some elements...
          s1.add(3);
          s1.add(4);
          s1.add(13);
          s1.add(1);
          // Start a traversal of the elements in the set.
          it = new setIterator(s1);
          // The elements??? are fetched in the order: 1, 3, 4, 13
          print it.toString(); //??? prints “(begin)[1]”
          while (it.more())
          {
          //? Fetch the next element
          theElement = it.value();
          print theElement;
          it.next();
          }
          pause;
          -----------------------------------
          List
          ----------------------
          list il = new list(types::integer);
          listIterator it;
          // Add some elements into the list...
          il.addStart(1);
          il.addStart(2);
          il.addStart(4);

          // Create a list iterator
          it = new listIterator (il);
          ?? print it.definitionString(); // prints “int list iterator”
          ?? print it.toString(); // prints “(begin)[4]”
          // Go on for as long as elements are found in the list...
          while (it.more())
          ?? {
          // fetch the next element
          print it.value(); // prints 4 2 1
          it.next();
          ?? }
          print it.toString();??? // prints (end)
          pause;

          posted on 2006-08-12 11:21 舞熙 閱讀(284) 評論(0)  編輯  收藏 所屬分類: 程序設(shè)計語言
          主站蜘蛛池模板: 浠水县| 青铜峡市| 巫溪县| 牟定县| 达州市| 泗阳县| 昌吉市| 嘉善县| 仁化县| 肃南| 宜兴市| 黄浦区| 定安县| 岑溪市| 秀山| 辽源市| 连南| 贡山| 阿图什市| 台南市| 图木舒克市| 黄陵县| 迁西县| 西吉县| 高雄县| 墨脱县| 封丘县| 西城区| 云龙县| 阿尔山市| 庄浪县| 兰溪市| 宜州市| 巴林左旗| 会理县| 连山| 凌源市| 临沂市| 仲巴县| 囊谦县| 黄陵县|