Package com.esotericsoftware.kryo.pool
Class SoftReferenceQueue
- java.lang.Object
-
- com.esotericsoftware.kryo.pool.SoftReferenceQueue
-
- All Implemented Interfaces:
java.lang.Iterable<Kryo>
,java.util.Collection<Kryo>
,java.util.Queue<Kryo>
class SoftReferenceQueue extends java.lang.Object implements java.util.Queue<Kryo>
Internally usesSoftReference
s for queued Kryo instances, most importantly adjusts thepoll
behavior so that GC'ed Kryo instances are skipped. Most other methods are unsupported.
-
-
Constructor Summary
Constructors Constructor Description SoftReferenceQueue(java.util.Queue<?> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Kryo e)
boolean
addAll(java.util.Collection<? extends Kryo> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
Kryo
element()
boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<Kryo>
iterator()
boolean
offer(Kryo e)
Kryo
peek()
Kryo
poll()
Kryo
remove()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
-
-
-
Field Detail
-
delegate
private java.util.Queue<java.lang.ref.SoftReference<Kryo>> delegate
-
-
Method Detail
-
add
public boolean add(Kryo e)
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<Kryo>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<Kryo>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<Kryo>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<Kryo>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<Kryo>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<Kryo>
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
iterator
public java.util.Iterator<Kryo> iterator()
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<Kryo>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<Kryo>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<Kryo>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<Kryo>
-
addAll
public boolean addAll(java.util.Collection<? extends Kryo> c)
- Specified by:
addAll
in interfacejava.util.Collection<Kryo>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<Kryo>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<Kryo>
-
-