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 voidfree()Manually release this memory area.Tget()Gets the content of this memory area.longgetSize()Get the size that was requested for this memory area.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ManualFreeMemoryHandle
ManualFreeMemoryHandle(java.lang.String name, T content, long size)
-
-
Method Detail
-
get
public T get()
Description copied from interface:MemoryManager.MemoryHandleGets 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:
getin interfaceMemoryManager.MemoryHandle<T>- Returns:
- The memory area content.
-
getSize
public long getSize()
Description copied from interface:MemoryManager.MemoryHandleGet the size that was requested for this memory area.- Specified by:
getSizein interfaceMemoryManager.MemoryHandle<T>- Returns:
- the size
-
free
public void free()
Description copied from interface:MemoryManager.MemoryHandleManually release this memory area. There should be no memory consumed by this afterwards.- Specified by:
freein interfaceMemoryManager.MemoryHandle<T>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-