2
0

L2ObjectMap.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * $Header: L2ObjectMap.java, 22/07/2005 13:17:51 luisantonioa Exp $
  3. *
  4. * $Author: luisantonioa $
  5. * $Date: 22/07/2005 13:17:51 $
  6. * $Revision: 1 $
  7. * $Log: L2ObjectMap.java,v $
  8. * Revision 1 22/07/2005 13:17:51 luisantonioa
  9. * Added copyright notice
  10. *
  11. *
  12. * This program is free software: you can redistribute it and/or modify it under
  13. * the terms of the GNU General Public License as published by the Free Software
  14. * Foundation, either version 3 of the License, or (at your option) any later
  15. * version.
  16. *
  17. * This program is distributed in the hope that it will be useful, but WITHOUT
  18. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  19. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  20. * details.
  21. *
  22. * You should have received a copy of the GNU General Public License along with
  23. * this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. package com.l2jserver.util;
  26. import java.util.Iterator;
  27. import com.l2jserver.Config;
  28. import com.l2jserver.gameserver.model.L2Object;
  29. /**
  30. * This class ...
  31. *
  32. * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  33. */
  34. public abstract class L2ObjectMap<T extends L2Object> implements Iterable<T>
  35. {
  36. public abstract int size();
  37. public abstract boolean isEmpty();
  38. public abstract void clear();
  39. public abstract void put(T obj);
  40. public abstract void remove(T obj);
  41. public abstract T get(int id);
  42. public abstract boolean contains(T obj);
  43. public abstract Iterator<T> iterator();
  44. public static L2ObjectMap<L2Object> createL2ObjectMap()
  45. {
  46. switch (Config.MAP_TYPE)
  47. {
  48. case WorldObjectMap:
  49. return new WorldObjectMap<L2Object>();
  50. default:
  51. return new WorldObjectTree<L2Object>();
  52. }
  53. }
  54. }