Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/collections/ObjectPool.java')
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/collections/ObjectPool.java32
1 files changed, 0 insertions, 32 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/collections/ObjectPool.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/collections/ObjectPool.java
deleted file mode 100644
index e16ba417410..00000000000
--- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/collections/ObjectPool.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.osee.ote.collections;
-
-import java.util.concurrent.ArrayBlockingQueue;
-
-public class ObjectPool<T> {
-
- private final ArrayBlockingQueue<T> objs;
- private final ObjectPoolConfiguration<T> config;
-
- public ObjectPool(ObjectPoolConfiguration<T> config) {
- this.config = config;
- objs = new ArrayBlockingQueue<>(config.getMaxSize());
- if(config.preallocate()){
- for(int i = 0; i < config.getMaxSize(); i++){
- objs.offer(config.make());
- }
- }
- }
-
- public T getObject(){
- T obj = objs.poll();
- if(obj == null){
- obj = config.make();
- }
- return obj;
- }
-
- public void returnObj(T obj){
- objs.offer(obj);
- }
-
-}

Back to the top