Package org.openstreetmap.josm.tools
Class MemoryManager.ManualFreeMemoryHandle<T>
- java.lang.Object
-
- org.openstreetmap.josm.tools.MemoryManager.ManualFreeMemoryHandle<T>
-
- All Implemented Interfaces:
MemoryManager.MemoryHandle<T>
- Enclosing class:
- MemoryManager
private class MemoryManager.ManualFreeMemoryHandle<T> extends java.lang.Object implements MemoryManager.MemoryHandle<T>
-
-
Constructor Summary
Constructors Constructor Description ManualFreeMemoryHandle(java.lang.String name, T content, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
free()
Manually release this memory area.T
get()
Gets the content of this memory area.long
getSize()
Get the size that was requested for this memory area.java.lang.String
toString()
-
-
-
Constructor Detail
-
ManualFreeMemoryHandle
ManualFreeMemoryHandle(java.lang.String name, T content, long size)
-
-
Method Detail
-
get
public T get()
Description copied from interface:MemoryManager.MemoryHandle
Gets the content of this memory area.This method should be the preferred access to the memory since it will do error checking when
MemoryManager.MemoryHandle.free()
was called.- Specified by:
get
in interfaceMemoryManager.MemoryHandle<T>
- Returns:
- The memory area content.
-
getSize
public long getSize()
Description copied from interface:MemoryManager.MemoryHandle
Get the size that was requested for this memory area.- Specified by:
getSize
in interfaceMemoryManager.MemoryHandle<T>
- Returns:
- the size
-
free
public void free()
Description copied from interface:MemoryManager.MemoryHandle
Manually release this memory area. There should be no memory consumed by this afterwards.- Specified by:
free
in interfaceMemoryManager.MemoryHandle<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-