Top Fields Constructors Methods
org.apache.pdfbox.jbig2.util.cache

public Class SoftReferenceCache

extends Object
implements Cache
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.jbig2.util.cache.Cache
Imports
java.lang.ref.SoftReference, java.util.Collections, .Map, .WeakHashMap

Field Summary

Modifier and TypeField and Description
private final Map<Object, SoftReference<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.apache.pdfbox.jbig2.util.cache.Cache.clear.

Removes all mappings from a map (optional operation).

public Object
private Object
getValueNullSafe(SoftReference<?> softReference)

public Object
put(Object
value to be used as key
key
,
Object
value to be stored
value
,
int
estimated size
sizeEstimate
)

Implements org.apache.pdfbox.jbig2.util.cache.Cache.put.

public Object
remove(Object
the key of the to be removed object
key
)

Implements org.apache.pdfbox.jbig2.util.cache.Cache.remove.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private final Map<Object, SoftReference<?>> cache

Constructor Detail

SoftReferenceCacheback to summary
public SoftReferenceCache()

Method Detail

clearback to summary
public void clear()

Implements org.apache.pdfbox.jbig2.util.cache.Cache.clear.

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.clear.

Removes all mappings from a map (optional operation).

Annotations
@Override
getback to summary
public Object get(Object key)

Implements org.apache.pdfbox.jbig2.util.cache.Cache.get.

Annotations
@Override
getValueNullSafeback to summary
private Object getValueNullSafe(SoftReference<?> softReference)
putback to summary
public Object put(Object key, Object value, int sizeEstimate)

Implements org.apache.pdfbox.jbig2.util.cache.Cache.put.

Parameters
key:Object

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.put.

value to be used as key

value:Object

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.put.

value to be stored

sizeEstimate:int

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.put.

estimated size

Returns:Object

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.put.

the old object, that was replaced if present. Otherwise null.

Annotations
@Override
removeback to summary
public Object remove(Object key)

Implements org.apache.pdfbox.jbig2.util.cache.Cache.remove.

Parameters
key:Object

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.remove.

the key of the to be removed object

Returns:Object

Doc from org.apache.pdfbox.jbig2.util.cache.Cache.remove.

the removed object, if present. Otherwise null.

Annotations
@Override