亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? actorpool.java

?? 大量j2me源代碼
?? JAVA
字號(hào):
/**
 * A pool of objects for use in situations where you want to minimize object
 * lifecycling (and subsequently garbage collection). It also serves as a very
 * high speed, minimal overhead collection for small numbers of objects.
 * <p>
 * Keep in mind that Actors that are pooled are not constructed; they are
 * "reset" when handed out. You need to "grab" one and then call init to setup
 * the actor for its new use.
 * <p>
 * This class maintains two lists in order to differientiate between actors
 * in use and those that are unallocated from the pool. This allows for much
 * faster cycling of only the in-use actors.
 */

public class ActorPool
{
   private Actor firstFree;		// ref to the head of the free actor list
   private Actor lastFree;
   private Actor firstUsed;		// ref to the head of the used list (oldest)
   private Actor oldestUsed;
   private Actor lastUsed;

   /**
    * Constructs an actor pool using a base of objects passed in as an array.
    * @param initObjects The starting objects for the pool.
    */
   public ActorPool(Actor[] initObjects)
   {
      if (initObjects == null || initObjects.length < 2)
         return;

      // init the linked list of free objects
      firstFree = initObjects[0];
      lastFree = initObjects[initObjects.length - 1];

      for (int i = 0; i < initObjects.length; i++)
      {
         if (i < initObjects.length - 1)
            initObjects[i].setNextLinked(initObjects[i + 1]);
         else
            initObjects[i].setNextLinked(null);

         if (i > 0)
            initObjects[i].setPrevLinked(initObjects[i - 1]);
         else
            initObjects[i].setPrevLinked(null);
      }
   }

   /**
    * Returns the next free object by moving it from the free pool to the used
    * one. If no free objects are available it returns the oldest from the used
    * pool.
    */
   public Actor getNextFree()
   {
      // give out the next free one
      if (firstFree != null)
      {
         // return the next actor off the start of the free list
         if (firstFree.getNextLinked() != null)
            firstFree.getNextLinked().setPrevLinked(null);

         Actor newFirstFree = firstFree.getNextLinked();

         // now link this actor onto the end of the used list
         firstFree.setNextLinked(null);
         if (lastUsed != null)
         {
            firstFree.setPrevLinked(lastUsed);
            lastUsed.setNextLinked(firstFree);
         }
         lastUsed = firstFree;

         if (oldestUsed == null)
            oldestUsed = firstFree;
         if (firstUsed == null)
            firstUsed = firstFree;

         // if we're giving out the last one then clear lastFree
         if (lastFree == firstFree)
            lastFree = null;

         Actor actorToReturn = firstFree;
         firstFree = newFirstFree;

         return actorToReturn;
      }

      // none free, hand out the oldest from the used list and make it's
      // next the oldestUsed (so we don't just keep reusing this one)
      Actor actorToReturn = oldestUsed;
      if (oldestUsed == null)
      {
         // we've been through the whole list, restart from the top
         oldestUsed = firstUsed;
         actorToReturn = oldestUsed;
      }
      // since we've handed this guy out, make the next one the oldest
      // (if that's null we'll catch it next time around anyway).
      oldestUsed = oldestUsed.getNextLinked();
      return actorToReturn;
   }

   /**
    * Outputs the contents of the current lists. Usually for debugging.
    */
   public void dump()
   {
      System.out.print("FREE LIST: ");
      Actor a = firstFree;
      while (a != null)
      {
         System.out.print("{" + a + "} ");
         a = a.getNextLinked();
      }
      System.out.println("");

      System.out.print("USED LIST: ");
      a = firstUsed;
      while (a != null)
      {
         System.out.print("{" + a + "} ");
         a = a.getNextLinked();
      }
      System.out.println("");
      System.out.println("LastUsed: {" + lastUsed + "} OldestUsed: {" + oldestUsed +
                         "} firstUsed: {" + firstUsed +
                         "} LastFree: {" + lastFree + "} firstFree: {" + firstFree + "}");

   }

   /**
    * Releases an actor by moving it from the used list back to the free list.
    * @param actorToRelease
    */
   public void release(Actor actorToRelease)
   {
      // add this actor back onto the end of the free list

      if (actorToRelease.getPrevLinked() != null)
      // join the break in the used list
         actorToRelease.getPrevLinked().setNextLinked(actorToRelease.getNextLinked());
      if (actorToRelease.getNextLinked() != null)
         actorToRelease.getNextLinked().setPrevLinked(actorToRelease.getPrevLinked());

      // if this actor was the oldestUsed then make it's next take that place
      if (oldestUsed == actorToRelease)
         oldestUsed = actorToRelease.getNextLinked();
      if (firstUsed == actorToRelease)
         firstUsed = actorToRelease.getNextLinked();
      if (lastUsed == actorToRelease)
         lastUsed = actorToRelease.getPrevLinked();

      // now move this actor onto the end of the free list
      actorToRelease.setNextLinked(null);
      if (firstFree == null)
      {
         firstFree = actorToRelease;
         actorToRelease.setPrevLinked(null);
      }

      if (lastFree != null)
      {
         actorToRelease.setPrevLinked(lastFree);
         lastFree.setNextLinked(actorToRelease);
      }
      else
         actorToRelease.setPrevLinked(null);

      lastFree = actorToRelease;
   }

   public Actor getFirstUsed()
   {
      return firstUsed;
   }


}



?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产美| 欧美一卡二卡三卡| 97久久超碰国产精品电影| 国产成人高清在线| 一区二区三区精品视频| 中文一区二区完整视频在线观看| 久久亚洲二区三区| 国产精品乱码一区二区三区软件 | 1024精品合集| 亚洲日本在线a| 亚洲自拍欧美精品| 七七婷婷婷婷精品国产| 国产一区在线看| 粉嫩在线一区二区三区视频| 99久久综合精品| fc2成人免费人成在线观看播放| 国产精品亚洲成人| 丁香网亚洲国际| 在线观看日韩毛片| 欧美成人精品1314www| 日韩午夜精品电影| 国产精品日韩成人| 日韩精品一二区| 国产成人在线看| 欧洲精品视频在线观看| 日韩一级精品视频在线观看| 精品国产乱码久久久久久1区2区| 久久久噜噜噜久噜久久综合| 亚洲欧美日韩国产一区二区三区| 午夜亚洲国产au精品一区二区| 国产一区视频在线看| 在线亚洲一区观看| 中文字幕第一区二区| 五月天亚洲精品| 盗摄精品av一区二区三区| 欧美日韩成人在线一区| 国产日韩综合av| 人人狠狠综合久久亚洲| 国产99久久久国产精品潘金 | 欧美—级在线免费片| 国产精品激情偷乱一区二区∴| 天堂久久久久va久久久久| 国产福利一区二区三区在线视频| 欧美色图天堂网| 国产精品福利影院| 麻豆高清免费国产一区| 欧美日韩的一区二区| 亚洲资源在线观看| 99re热视频精品| 亚洲午夜影视影院在线观看| 欧美日韩午夜在线视频| 亚洲午夜免费电影| 欧美二区乱c少妇| 青青国产91久久久久久| 久久久久成人黄色影片| 成人毛片老司机大片| 亚洲国产乱码最新视频| 日韩欧美在线综合网| 狠狠狠色丁香婷婷综合激情 | 欧美一区二区三区在线看| 美腿丝袜亚洲综合| 中文字幕欧美激情| 欧美在线不卡一区| 国产一区不卡精品| 一区二区三区四区乱视频| 91精品欧美一区二区三区综合在| 蜜桃久久久久久| 亚洲欧美视频一区| 91精品国产色综合久久不卡电影| 国产精品一区二区果冻传媒| 亚洲欧美日本在线| 2022国产精品视频| 在线亚洲精品福利网址导航| 久久疯狂做爰流白浆xx| 亚洲视频一区二区免费在线观看| 欧美一区二区精品在线| www.欧美日韩| 精品一区免费av| 午夜私人影院久久久久| 亚洲天堂2014| 中文字幕免费一区| 国产午夜精品理论片a级大结局| 欧美精品高清视频| 色综合天天综合网天天看片| 国产成人精品免费看| 精品一区二区三区av| 亚洲国产中文字幕| 亚洲国产日韩在线一区模特| 中文字幕日韩一区| 国产欧美日韩综合精品一区二区| 精品国产三级a在线观看| 91精品国产美女浴室洗澡无遮挡| 欧美色老头old∨ideo| 91国偷自产一区二区三区成为亚洲经典| 国产一区二区成人久久免费影院| 视频一区二区三区中文字幕| 午夜成人在线视频| 免费久久精品视频| 一区二区三区精品在线观看| 国产三级精品三级| 国产午夜精品一区二区| 国产色一区二区| 国产精品拍天天在线| 国产精品网友自拍| 国产精品高潮久久久久无| 国产精品久久精品日日| 亚洲黄色片在线观看| 亚洲成人中文在线| 久久国产精品99久久人人澡| 国产一区二区三区在线观看精品 | 精品国产一区二区三区忘忧草| 欧美精品一卡二卡| www亚洲一区| 亚洲日本va在线观看| 午夜免费欧美电影| 狠狠色丁香婷婷综合| 91亚洲男人天堂| 91麻豆精品91久久久久同性| 欧美一级欧美一级在线播放| 久久精品夜色噜噜亚洲a∨| 一区二区三区在线视频免费| 日韩制服丝袜先锋影音| 国产自产2019最新不卡| 91色九色蝌蚪| 日韩欧美激情一区| 亚洲一区二区在线免费观看视频| 美美哒免费高清在线观看视频一区二区 | 日韩电影一区二区三区| av激情成人网| 久久久www免费人成精品| 夜夜夜精品看看| 成人激情视频网站| 精品少妇一区二区三区日产乱码 | 国产精品国模大尺度视频| 日本亚洲三级在线| 欧美在线|欧美| 中文字幕一区二区三区色视频| 日韩在线一区二区| 在线视频综合导航| 亚洲免费在线视频一区 二区| 国产成人啪免费观看软件| 91精品国产91综合久久蜜臀| 亚洲制服欧美中文字幕中文字幕| 国产成人在线视频免费播放| 欧美成人精品高清在线播放| 日韩国产在线一| 欧美久久久久中文字幕| 亚洲国产一区视频| 欧美日韩精品一二三区| 亚洲成人高清在线| 欧美剧在线免费观看网站| 亚洲成人综合网站| 欧美日韩在线观看一区二区| 亚洲一级二级在线| 欧美午夜精品一区二区三区| 亚洲成a人片在线观看中文| 欧美唯美清纯偷拍| 日韩精品国产精品| 久久亚洲综合色一区二区三区| 国产精品一区二区在线观看网站| 精品欧美久久久| 成人免费av在线| 一区二区三区日韩精品| 6080亚洲精品一区二区| 午夜精品视频在线观看| 成人97人人超碰人人99| 亚洲色图清纯唯美| 欧美人狂配大交3d怪物一区 | 成人午夜视频网站| 亚洲欧美一区二区三区国产精品 | 国产欧美日韩另类视频免费观看| 懂色av中文一区二区三区| 一区二区三区四区在线| 欧美一区二区三区日韩视频| 欧美aⅴ一区二区三区视频| 国产蜜臀97一区二区三区| 欧美色综合影院| 国产一区二区三区黄视频 | 久久综合五月天婷婷伊人| 不卡的av中国片| 久久99九九99精品| 亚洲日本中文字幕区| 欧美精品一区二区三区四区 | 一区二区三区不卡视频| 日韩欧美高清一区| 91美女在线观看| 国产一区二区三区在线观看精品| 亚洲综合激情网| 欧美高清在线精品一区| 日韩一区二区在线观看| 色婷婷国产精品久久包臀| 国产在线精品一区二区夜色| 午夜久久久影院| 亚洲欧美色一区| 亚洲国产成人私人影院tom| 欧美xxxxx裸体时装秀| 在线观看免费亚洲| 色8久久人人97超碰香蕉987| 国产激情视频一区二区在线观看 | 亚洲美女免费视频|