com.sun.labs.minion.util.buffer
Interface Buffer

All Known Subinterfaces:
ReadableBuffer, WriteableBuffer
All Known Implementing Classes:
ArrayBuffer, ChannelReadableBuffer, FileBackedPostingsInput, FileReadableBuffer, FileWriteableBuffer, NIOBuffer, StdBufferImpl, StdReadableImpl

public interface Buffer

An interface for the buffers used by the search engine. Buffers have a postition that indicates where the next byte will be written or read, a limit that indicates the last byte that may be written or read, and a way to determine how much space is remaining in a buffer.

See Also:
WriteableBuffer, ReadableBuffer

Method Summary
 int limit()
          Gets the limit of this buffer, i.e., the last readable position.
 void limit(int l)
          Sets the limit of this buffer, i.e., the last readable position.
 int position()
          Gets the position in the buffer.
 void position(int position)
          Sets the position in the buffer.
 int remaining()
          Gets the amount of space remaining in the buffer.
 

Method Detail

position

int position()
Gets the position in the buffer.

Returns:
The position in the buffer.

position

void position(int position)
Sets the position in the buffer.

Parameters:
position - The point to which the buffer's position should be set.

limit

int limit()
Gets the limit of this buffer, i.e., the last readable position.


limit

void limit(int l)
Sets the limit of this buffer, i.e., the last readable position.


remaining

int remaining()
Gets the amount of space remaining in the buffer.