Fixed classpath (removed woodstox), added files for fastObjectPool
This commit is contained in:
parent
99c32e9863
commit
9b1ee07cf8
|
@ -24,5 +24,6 @@
|
|||
<classpathentry kind="lib" path="/Dependencies/asm/asm-5.0.3.jar" sourcepath="/Dependencies/asm/asm-5.0.3-src.zip"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/JavaLauncher-Util"/>
|
||||
<classpathentry kind="lib" path="/Dependencies/jodaTime/joda-time-2.4.jar" sourcepath="/Dependencies/jodaTime/joda-time-2.4-sources.zip"/>
|
||||
<classpathentry kind="output" path="classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package dorkbox.util.objectPool;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Holder<T> {
|
||||
private T value;
|
||||
|
||||
static final int FREE = 0;
|
||||
static final int USED = 1;
|
||||
|
||||
AtomicInteger state = new AtomicInteger(FREE);
|
||||
|
||||
|
||||
public Holder(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public T getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package dorkbox.util.objectPool;
|
||||
|
||||
public interface PoolFactory<T> {
|
||||
public T create();
|
||||
}
|
Loading…
Reference in New Issue