Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.emory.mathcs.util.allocator
Class Allocator.Buffer

    java.lang.Object
      edu.emory.mathcs.util.allocator.Allocator.Buffer

Enclosing class:
  Allocator

public abstract static class Allocator.Buffer
extends java.lang.Object

Represents the data buffer returned to the application as a result of `allocate()` request. Contains actual byte[] array and the size value. Users should access only the [0..size] region of the array, since the initial content of the remaining part is undefined.

Field Summary
`protected byte[]` | `data`
`protected int` | `size`

Constructor Summary
`protected` | `Allocator.Buffer(byte[] data, int size)`

Method Summary
`void` | `addRef()` Increase reference count on this buffer.
`byte[]` | `getData()` Returns the data array encapsulated in this buffer.
`int` | `getSize()` Returns the size of this buffer.
`protected abstract void` | `reclaim()`
`void` | `releaseRef()` Decrease the reference count on this buffer.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### data

    protected final byte[] data

### size

    protected final int size

Constructor Detail

### Allocator.Buffer

    protected Allocator.Buffer(byte[] data,
                               int size)

Method Detail

### getData

    public byte[] getData()

  Returns the data array encapsulated in this buffer.

  Returns:
    the data array.
  See Also:
    `getSize()`

### getSize

    public int getSize()

  Returns the size of this buffer. The length of the array encapsulated in this buffer can be larger than that value, but users are expected to access only the [0..size] region of the array.

  Returns:
    size of the buffer.
  See Also:
    `getData()`

### addRef

    public void addRef()

  Increase reference count on this buffer.

### releaseRef

    public void releaseRef()

  Decrease the reference count on this buffer. When the reference count reaches 0, the buffer may be reclaimed by the allocator and results of any further usage of that buffer are undefined.

### reclaim

    protected abstract void reclaim()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD