# AbstractDataBufferWindow

public abstract class **AbstractDataBufferWindow**

### Public Methods

|---|---|
| final B | [buffer](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow#buffer())() Returns the buffer backing this window. |
| final long | [offset](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow#offset())() Returns the current offset of this window in the original buffer. |
| final long | [size](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow#size())() Returns the size of this buffer window. |
| final [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\> | [slide](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow#slide(long))(long step) Moves the window of `step` elements in the original buffer. |
| final [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\> | [slideTo](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow#slideTo(long))(long index) Moves the window at the given position in the original buffer. |

### Inherited Methods

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface [org.tensorflow.ndarray.buffer.DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)

|---|---|
| abstract B | [buffer](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#buffer())() Returns the buffer backing this window. |
| abstract long | [offset](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#offset())() Returns the current offset of this window in the original buffer. |
| abstract long | [size](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#size())() Returns the size of this buffer window. |
| abstract [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\> | [slide](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#slide(long))(long step) Moves the window of `step` elements in the original buffer. |
| abstract [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\> | [slideTo](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#slideTo(long))(long index) Moves the window at the given position in the original buffer. |

## Public Methods

#### public final B
**buffer**
()

Returns the buffer backing this window.

Each window instance has it's own buffer providing a view onto the original
`https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBuffer`. The buffers are mutated when the window slides to different offsets.
For example:

    IntDataBuffer buffer = DataBuffers.of(0, 1, 2, 3);
     DataBufferWindow<IntDataBuffer> window = buffer.window(0, 2);

     IntDataBuffer windowBuffer = window.buffer();
     assertEquals(0, windowBuffer.getInt(0));
     assertEquals(1, windowBuffer.getInt(1));

     window.slideTo(2);
     assertEquals(2, windowBuffer.getInt(0));
     assertEquals(3, windowBuffer.getInt(1));
     assertSame(windowBuffer, window.buffer());
     
<br />

<br />

##### Returns

- this window's buffer

#### public final long
**offset**
()

Returns the current offset of this window in the original buffer.

#### public final long
**size**
()

Returns the size of this buffer window.

#### public final [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\>
**slide**
(long step)

Moves the window of `step` elements in the original buffer.

The size of the window remains the same and its offset is set to `offset() + step`.
If `step` is positive, then the window will slide forward. If it is negative, it will
slide backward.

<br />

##### Parameters

| step | value to add to the current offset of this window |
|---|---|

##### Returns

- this instance

#### public final [DataBufferWindow](https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow)\<B\>
**slideTo**
(long index)

Moves the window at the given position in the original buffer.

The size of the window remains the same and its offset is set to `index`, so that
accessing the value of `https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBufferWindow#buffer()` at index `x` will return the value at
`index + x` in the original buffer.

<br />

##### Parameters

| index | new offset for this window |
|---|---|

##### Returns

- this instance