org.icepdf.core.util
Interface MemoryManagerDelegate

All Known Implementing Classes:
LazyObjectLoader

public interface MemoryManagerDelegate

Sometimes it might not make sense to have a fullblown MemoryManager taking care of some resources, but instead have a delegate that the MemoryManager can make use of. This is the interface for those delegates to implement.

Since:
2.0
Author:
Mark Collette

Field Summary
static int REDUCE_AGGRESSIVELY
          When we're desperately low on memory, we should aggressively reduce memory usage, or else being too timid will simply waste time
static int REDUCE_SOMEWHAT
          Since we don't always want to eliminate all caching, when we're low on memory, for performance reasons, this is an indicator to conservatively reduce memory
 
Method Summary
 Library getLibrary()
          Get the documents library object.
 boolean reduceMemory(int reductionPolicy)
          Reduce the amount of memory, as managed by this delegate.
 

Field Detail

REDUCE_SOMEWHAT

static final int REDUCE_SOMEWHAT
Since we don't always want to eliminate all caching, when we're low on memory, for performance reasons, this is an indicator to conservatively reduce memory

See Also:
Constant Field Values

REDUCE_AGGRESSIVELY

static final int REDUCE_AGGRESSIVELY
When we're desperately low on memory, we should aggressively reduce memory usage, or else being too timid will simply waste time

See Also:
Constant Field Values
Method Detail

reduceMemory

boolean reduceMemory(int reductionPolicy)
Reduce the amount of memory, as managed by this delegate. In most cases the PDF object dispose method should be called.

Returns:
true, if any memory was reduced; false, otherwise

getLibrary

Library getLibrary()
Get the documents library object.

Returns:
documents library object.