Back to project page ssniper-andengine.
The source code is released under:
Apache License
If you think the Android project ssniper-andengine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.cladophora.ssniper; /*from ww w .j av a 2s . co m*/ import com.cladophora.ssniper.entity.Item; import org.andengine.util.adt.pool.GenericPool; public class ItemPool extends GenericPool<Item> { public static ItemPool instance; public static ItemPool getSharedInstance() { if (instance == null) { instance = new ItemPool(); } return instance; } private ItemPool() { super(); } @Override protected Item onAllocatePoolItem() { return new Item(); } @Override protected void onHandleObtainItem(Item pItem) { pItem.init(); } @Override protected void onHandleRecycleItem(final Item item) { item.clean(); super.onHandleRecycleItem(item); } }