1 23 24 29 42 43 48 49 50 package com.sun.enterprise.util.pool; 51 52 import java.util.Collection ; 53 import java.util.ArrayList ; 54 55 68 public abstract class ArrayListPool 69 extends AbstractPool 70 { 71 protected ArrayList arrayList; 72 73 protected ArrayListPool(ObjectFactory factory) { 74 super.factory = factory; 75 super.collection = this.arrayList = new ArrayList (6); 76 } 77 78 protected ArrayListPool(ObjectFactory factory, int initialCapacity) { 79 super.factory = factory; 80 super.collection = this.arrayList = new ArrayList (initialCapacity); 81 } 82 83 91 protected Object checkin(Object object) { 92 collection.add(object); 93 return this; 94 } 95 96 103 protected Object checkout() { 104 return arrayList.remove(arrayList.size() - 1); 105 } 106 107 114 protected Object checkout(long param) { 115 return arrayList.remove(arrayList.size() - 1); 116 } 117 118 125 protected Object checkout(Object param) { 126 return arrayList.remove(arrayList.size() - 1); 127 } 128 } | Popular Tags |