AbstractDataBuffer

abstract class AbstractDataBuffer<T> : DataBuffer


Default implementation of DataBuffer. An AbstractDataBuffer wraps data provided across the binder from Google Play services.

Summary

Public functions

Unit

Releases the data buffer, for use in try-with-resources.

abstract T
get(position: Int)

Get the item at the specified position.

Int
Boolean

This function is deprecated.

release and close are idempotent, and so is safe to call multiple times

(Mutable)Iterator<T!>!
Unit

Releases resources used by the buffer.

(Mutable)Iterator<T!>!

In order to use this you should correctly override setDataRow in your DataBufferRef implementation.

Inherited functions

From java.io.Closeable
abstract Unit
From java.lang.Iterable

Public functions

close

fun close(): Unit

Releases the data buffer, for use in try-with-resources.

Both close and release shall have identical semantics, and are idempotent.

get

abstract fun get(position: Int): T

Get the item at the specified position. Note that the objects returned from subsequent invocations of this method for the same position may not be identical objects, but will be equal in value. In other words:

buffer.get(i) == buffer.get(i) may return false.

buffer.get(i).equals(buffer.get(i)) will return true.

Parameters
position: Int

The position of the item to retrieve.

Returns
T

the item at position in this buffer.

getCount

fun getCount(): Int

isClosed

fun isClosed(): Boolean

iterator

fun iterator(): (Mutable)Iterator<T!>!

release

fun release(): Unit

Releases resources used by the buffer. This method is idempotent.

singleRefIterator

fun singleRefIterator(): (Mutable)Iterator<T!>!

In order to use this you should correctly override setDataRow in your DataBufferRef implementation. Be careful: there will be single while iterating. If you are not sure - DO NOT USE this iterator.