Interface ILcdBufferSegment


public interface ILcdBufferSegment
An ILcdBufferSegment defines a segment of an ILcdBuffer. A segment is specified by the index of its first byte and by its size, expressed in bytes.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    enlarge(int aNumberOfBytes)
    Returns if the buffer segment could be enlarged with the specified size.
    Returns the ILcdBuffer to which this ILcdBufferSegment is associated.
    int
    Returns the index of the first byte of this ILcdBufferSegment in its ILcdBuffer, or -1 if no bytes are allocated.
    int
    Returns the number of bytes occupied by this ILcdBufferSegment in its ILcdBuffer.
    boolean
    Returns if the buffer segment is still valid.
  • Method Details

    • getBuffer

      ILcdBuffer getBuffer()
      Returns the ILcdBuffer to which this ILcdBufferSegment is associated.
      Returns:
      the ILcdBuffer to which this ILcdBufferSegment is associated.
    • getOffset

      int getOffset()
      Returns the index of the first byte of this ILcdBufferSegment in its ILcdBuffer, or -1 if no bytes are allocated.
      Returns:
      the index of the first byte of this ILcdBufferSegment in its ILcdBuffer, or -1 if no bytes are allocated.
    • getSize

      int getSize()
      Returns the number of bytes occupied by this ILcdBufferSegment in its ILcdBuffer.
      Returns:
      the number of bytes occupied by this ILcdBufferSegment in its ILcdBuffer. Note that the buffer may have invalidated this ILcdBufferSegment to make space for other segments. In that case, 0 will be returned.
    • isValid

      boolean isValid()
      Returns if the buffer segment is still valid.
      Returns:
      true if the buffer segment is still valid, false otherwise. A buffer segment may become invalid because more recently allocated buffer segments have taken over its buffer space.
    • enlarge

      boolean enlarge(int aNumberOfBytes)
      Returns if the buffer segment could be enlarged with the specified size.
      Parameters:
      aNumberOfBytes - the number of bytes to enlarge the buffer segment with if possible. Calling this method should only be done on the last allocated ILcdBufferSegment. Note that the offset can be changed as a result.
      Returns:
      true if the buffer segment could be enlarged with aNumberOfBytes bytes.