Package com.luciad.util
Class TLcdSharedBuffer
java.lang.Object
com.luciad.util.TLcdSharedBuffer
A
TLcdSharedBuffer
has an ILcdBuffer
that it can
provide to several users for shared use.- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createBufferInstance
(int aSize) Deprecated.use setBufferInstance(ILcdBuffer) instead.static void
dispose()
Removes the reference to the shared buffer held by thisTLcdSharedBuffer
.static ILcdBuffer
Returns the shared buffer of this class.static ILcdBuffer
getBufferInstance
(int aInt) Deprecated.initialize using setBufferInstance(ILcdBuffer) instead.static void
setBufferInstance
(ILcdBuffer aBuffer) Sets the sharedILcdBuffer
of this class.static ILcdBuffer
XgetBufferInstance
(int aSize) Deprecated.initialize using setBufferInstance(ILcdBuffer) instead.
-
Field Details
-
DEFAULT_SIZE
public static final int DEFAULT_SIZEDeprecated.getBufferInstance()
now returns a buffer that relies on Java memory allocation and garbage collection.The default size of the buffer, expressed in bytes.- See Also:
-
-
Constructor Details
-
TLcdSharedBuffer
public TLcdSharedBuffer()
-
-
Method Details
-
setBufferInstance
Sets the sharedILcdBuffer
of this class.- Parameters:
aBuffer
- the new ILcdBuffer.- See Also:
-
getBufferInstance
Returns the shared buffer of this class.- Returns:
- the shared buffer of this class. If the buffer has not been set, a new instance is created. This instance supports concurrent accesses.
- See Also:
-
getBufferInstance
Deprecated.initialize using setBufferInstance(ILcdBuffer) instead.Returns the shared buffer of this class, making sure that it has a give size.- Parameters:
aInt
- the size of the buffer (expressed in MB; 1MB==220 bytes).- Returns:
- the shared buffer of this class, making sure that it has a give size. If the buffer has not been set, a new instance is created.
- See Also:
-
createBufferInstance
public static void createBufferInstance(int aSize) Deprecated.use setBufferInstance(ILcdBuffer) instead.Creates a new shared buffer of the given size. Objects that are already using the current buffer (if any) can continue to use it. If no other objects are referencing the buffer anymore, the virtual machine's garbage collection can dispose of it, releasing the memory space it is taking up.- Parameters:
aSize
- the size of the buffer to be created, expressed in bytes.
-
XgetBufferInstance
Deprecated.initialize using setBufferInstance(ILcdBuffer) instead.Returns the shared buffer of this class.- Parameters:
aSize
- size of the shared buffer expressed in bytes- Returns:
- the shared buffer of this class.
If the buffer has not been created before, a new instance of size
DEFAULT_SIZE
is created. - See Also:
-
dispose
public static void dispose()Removes the reference to the shared buffer held by thisTLcdSharedBuffer
. Objects that are already using the buffer can continue to use it. If no other objects are referencing the buffer anymore, the virtual machine's garbage collection can dispose of it, releasing the memory space it is taking up.
-
getBufferInstance()
now returns a buffer that relies on Java memory allocation and garbage collection.