class

CogUtil::CognitiveCache(K, V)

Inherits Reference < Object

Cache-optimized data structure for cognitive operations

Constants

DEFAULT_CAPACITY = 8192

Cache configuration optimized for cognitive workloads

LOAD_FACTOR = 0.75

Constructors

new(capacity : Int32 = DEFAULT_CAPACITY)

Instance methods

[](key : K) : V | Nil

Get value by key with cache optimization

[]=(key : K, value : V)

Set value by key with LFU eviction

capacity

Current cache capacity

clear

Clear all entries

delete(key : K) : V | Nil

Remove key

has_key?(key : K) : Bool

Check if key exists

size

Current cache size

stats

Get cache statistics

utilization

Cache utilization percentage

Nested types