L2FastList.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C) 2004-2014 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.util;
  20. import java.util.Collection;
  21. import javolution.util.FastList;
  22. /**
  23. * A custom version of {@code FastList} with constructors that allow the constructed {@code FastList} to be shared without calling {@link FastList#shared()} method. <br>
  24. * @author Julian
  25. * @param <T>
  26. */
  27. public class L2FastList<T> extends FastList<T>
  28. {
  29. private static final long serialVersionUID = 8354641653178203420L;
  30. public L2FastList()
  31. {
  32. this(false);
  33. }
  34. public L2FastList(int initialCapacity)
  35. {
  36. this(initialCapacity, false);
  37. }
  38. public L2FastList(Collection<? extends T> c)
  39. {
  40. this(c, false);
  41. }
  42. public L2FastList(boolean shared)
  43. {
  44. super();
  45. if (shared)
  46. {
  47. shared();
  48. }
  49. }
  50. public L2FastList(int initialCapacity, boolean shared)
  51. {
  52. super(initialCapacity);
  53. if (shared)
  54. {
  55. shared();
  56. }
  57. }
  58. public L2FastList(Collection<? extends T> c, boolean shared)
  59. {
  60. super(c);
  61. if (shared)
  62. {
  63. shared();
  64. }
  65. }
  66. }