Object MRU/LRU cache
OperationsDefault constructor
New(type:Cache->Type, max:Int)
Name | Type | Description |
---|---|---|
type | Cache->Type | MRU or LRU cache |
max | Int | cache max size |
Clears the cache
method : public : Empty() ~ Nil
Searches for a value in cache
method : public : Find(key:K) ~ S
Name | Type | Description |
---|---|---|
key | K | search key |
Type | Description |
---|---|
S | found value, Nil if not found |
Gets a collection of key/value pairs
method : public : GetKeyValues() ~ Vector<Pair<K,S>>
Type | Description |
---|---|
Vector<Pair<K,S>> | vector of key/value pairs |
Get a collection of keys
method : public : GetKeys() ~ Vector<K>
Type | Description |
---|---|
Vector<K> | vector of keys |
Gets a collection of values
method : public : GetValues() ~ Vector<S>
Type | Description |
---|---|
Vector<S> | vector of values |
Checks for a value in a cache
method : public : Has(key:K) ~ Bool
Name | Type | Description |
---|---|---|
key | K | search key |
Type | Description |
---|---|
Bool | true if found, false otherwise |
Inserts a value into the hash
method : public : Insert(key:K, value:S) ~ Bool
Name | Type | Description |
---|---|---|
key | K | key |
value | S | value |
Checks to see if the cache is empty
method : public : IsEmpty() ~ Bool
Type | Description |
---|---|
Bool | true if empty, false otherwise |
Removes a value from the cache
method : public : Remove(key:K) ~ Bool
Name | Type | Description |
---|---|---|
key | K | key for value to remove |
Size of cache
method : public : Size() ~ Int
Type | Description |
---|---|
Int | size of cache |