FastGameDataCache

class FastGameDataCache(val capacity: Int) : GameDataCache

A GameDataCache implementation that uses hashing and a circular buffer.

Constructors

Link copied to clipboard
constructor(capacity: Int)

Properties

Link copied to clipboard
open override val capacity: Int

The maximum number of elements the cache can hold.

Link copied to clipboard
open override var size: Int

Functions

Link copied to clipboard
open override fun add(data: ByteBuf): Int

Adds the specified data to the cache.

Link copied to clipboard
open override fun clear()

Removes all elements from the cache and releases their resources.

Link copied to clipboard
open operator override fun contains(element: ByteBuf): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<ByteBuf>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): ByteBuf

Returns the element at the specified index in the cache.

Link copied to clipboard
open override fun indexOf(data: ByteBuf): Int

Returns the index of the last occurrence of the specified data in the cache, or -1 if the cache does not contain the element.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<ByteBuf>
Link copied to clipboard
open override fun remove(index: Int)

Removes the element at the specified index from the cache. Elements with indices greater than index are shifted down by one.