Class TLcdSharedBuffer

java.lang.Object
com.luciad.util.TLcdSharedBuffer

public class TLcdSharedBuffer extends Object
A TLcdSharedBuffer has an ILcdBuffer that it can provide to several users for shared use.
See Also:
  • Field Details

    • DEFAULT_SIZE

      public static final int DEFAULT_SIZE
      Deprecated.
      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

      public static void setBufferInstance(ILcdBuffer aBuffer)
      Sets the shared ILcdBuffer of this class.
      Parameters:
      aBuffer - the new ILcdBuffer.
      See Also:
    • getBufferInstance

      public static ILcdBuffer 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

      public static ILcdBuffer getBufferInstance(int aInt)
      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

      public static ILcdBuffer XgetBufferInstance(int aSize)
      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 this TLcdSharedBuffer. 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.