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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? actorpool.java

?? 大量j2me源代碼
?? JAVA
字號:
/**
 * 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;
   }


}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩亚洲综合在线| 亚洲一区免费视频| 亚洲午夜激情av| 夫妻av一区二区| 日韩一区二区三区电影在线观看| 国产欧美日韩精品a在线观看| 首页综合国产亚洲丝袜| 丁香激情综合国产| 久久久午夜精品| 久草精品在线观看| 欧美久久久一区| 亚洲高清视频在线| 91美女片黄在线| 久久精品噜噜噜成人av农村| 99九九99九九九视频精品| av电影天堂一区二区在线观看| 欧美综合亚洲图片综合区| 国产精品嫩草99a| 国产精品一区二区在线观看网站| 亚洲天堂免费看| 日韩精品欧美成人高清一区二区| 91久久一区二区| 欧美一区二区在线视频| 亚洲成人av中文| 久久久综合九色合综国产精品| 色噜噜狠狠色综合中国| 蜜臀av性久久久久蜜臀aⅴ| 日本一二三不卡| 欧美一级片在线| 97se亚洲国产综合自在线不卡 | 日韩欧美一区中文| zzijzzij亚洲日本少妇熟睡| 日精品一区二区| 中文字幕一区av| 日韩欧美中文一区二区| 一本一本大道香蕉久在线精品 | 国产麻豆精品视频| 亚洲成人1区2区| 国产精品素人一区二区| 337p亚洲精品色噜噜| 91在线视频在线| 国产精华液一区二区三区| 亚洲一区二区三区四区五区中文 | 欧美www视频| 欧美影院一区二区| gogogo免费视频观看亚洲一| 免费成人在线网站| 亚洲在线中文字幕| 亚洲欧美区自拍先锋| 久久久久国产精品厨房| 日韩一区二区三区观看| 欧美人与性动xxxx| 欧洲激情一区二区| 不卡一区二区在线| 国产成人精品在线看| 激情都市一区二区| 激情小说亚洲一区| 麻豆成人91精品二区三区| 丝瓜av网站精品一区二区| 一区二区三区鲁丝不卡| 伊人性伊人情综合网| 国产精品久久毛片a| 中文一区在线播放| 国产人妖乱国产精品人妖| 久久久精品黄色| 国产日韩欧美不卡在线| 久久久精品国产免费观看同学| 欧美mv日韩mv国产网站| 精品国产一二三区| 日韩欧美国产不卡| 精品国产免费人成在线观看| 日韩一区二区影院| 日韩精品在线一区二区| 日韩精品一区二区三区视频| 538在线一区二区精品国产| 制服.丝袜.亚洲.另类.中文| 欧美性感一区二区三区| 欧美体内she精高潮| 欧美日韩精品一区二区在线播放| 欧美视频在线一区| 欧美人体做爰大胆视频| 欧美一区二区三区视频在线| 91麻豆精品国产自产在线 | 国产欧美日韩麻豆91| 欧美国产激情一区二区三区蜜月| 国产日本欧美一区二区| 亚洲图片欧美激情| 亚洲成人自拍网| 久久国内精品视频| 成人一区在线看| av激情亚洲男人天堂| 色婷婷久久综合| 欧美精品久久久久久久久老牛影院| 在线播放亚洲一区| 久久综合成人精品亚洲另类欧美 | 久久男人中文字幕资源站| 久久影院午夜论| 成人免费小视频| 天天影视涩香欲综合网| 国产一区二区三区在线观看免费 | 91看片淫黄大片一级在线观看| 色综合天天在线| 日韩欧美专区在线| 亚洲欧洲国产日韩| 日本不卡123| 成人激情免费网站| 91麻豆精品国产自产在线观看一区 | 亚洲综合区在线| 男男视频亚洲欧美| 国产成人精品网址| 欧美精品视频www在线观看| 久久久国际精品| 亚洲地区一二三色| 高清av一区二区| 欧美一区二区性放荡片| 欧美高清在线精品一区| 午夜精品久久久久久久| 成人一区二区在线观看| 欧美日韩另类一区| 中文一区二区在线观看| 日韩高清一区二区| 日本久久一区二区三区| 久久亚洲一级片| 亚洲一线二线三线久久久| 国产精品77777竹菊影视小说| 欧美日韩午夜精品| 亚洲国产电影在线观看| 另类专区欧美蜜桃臀第一页| 成人av第一页| www日韩大片| 水野朝阳av一区二区三区| 91免费在线视频观看| 久久婷婷综合激情| 日韩精品福利网| 91高清视频在线| 亚洲国产精品av| 国产一区二区在线看| 91精品国产综合久久福利软件| 亚洲精品精品亚洲| 99re视频精品| 国产亚洲欧美日韩俺去了| 美国十次综合导航| 欧美日韩精品专区| 亚洲高清免费视频| 91浏览器在线视频| 亚洲日本免费电影| 99久久99久久综合| 中文字幕一区二| 不卡电影免费在线播放一区| 久久一区二区三区国产精品| 美女一区二区在线观看| 欧美一区二区高清| 日精品一区二区| 91麻豆精品91久久久久久清纯| 一区二区在线观看免费| 99精品欧美一区二区蜜桃免费| 欧美国产禁国产网站cc| 国产成人午夜99999| 26uuu精品一区二区| 国内精品不卡在线| 久久先锋资源网| 国产成人精品一区二区三区四区| 久久视频一区二区| 国产精品亚洲一区二区三区在线 | 成人精品高清在线| 国产精品成人免费| 99v久久综合狠狠综合久久| 中文字幕一区二区三区蜜月| 成人精品视频一区二区三区| 国产欧美日韩中文久久| 成人免费福利片| 成人欧美一区二区三区1314| 91在线观看视频| 亚洲精品你懂的| 欧美日韩免费高清一区色橹橹| 香蕉成人伊视频在线观看| 欧美精三区欧美精三区| 免费日本视频一区| 国产亚洲精品中文字幕| 99免费精品在线| 亚洲精品视频自拍| 欧美高清性hdvideosex| 蜜桃av一区二区三区电影| 欧美精品一区二区三区蜜桃| 国产成人在线网站| 一区二区三区中文在线观看| 欧美体内she精视频| www.色精品| 亚洲国产日日夜夜| 日韩美女一区二区三区四区| 国产一区二区不卡| 国产精品无人区| 91久久人澡人人添人人爽欧美 | 国产亚洲综合在线| 色综合久久中文字幕综合网| 亚洲国产中文字幕在线视频综合| 欧美一级二级三级乱码| 国产69精品久久久久毛片| 亚洲免费在线看| 欧美大片顶级少妇|