Class GenericCache<K, T>
A class to store and retreive T
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: LLBML.Utils
Assembly: LLBModdingLib.dll
Syntax
public abstract class GenericCache<K, T>
Type Parameters
| Name | Description |
|---|---|
| K | |
| T |
Fields
cache
The cache.
Declaration
protected Dictionary<K, List<T>> cache
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<K, System.Collections.Generic.List<T>> |
Properties
Count
The number of T currently stored in the cache
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[K]
Gets the System.Collections.Generic.List<T> with the specified key.
Declaration
public virtual List<T> this[K key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| K | key | Key. |
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<T> |
Logger
Declaration
protected static ManualLogSource Logger { get; }
Property Value
| Type | Description |
|---|---|
| BepInEx.Logging.ManualLogSource |
Methods
Add(K, T)
Adds the specified key and value to the cache.
Declaration
public virtual void Add(K key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| K | key | The key to insert into. |
| T | value | The value to insert. |
Clear()
Empties the cache
Declaration
public virtual void Clear()
ContainsKey(K)
Check if the cache contains the key
Declaration
public virtual bool ContainsKey(K key)
Parameters
| Type | Name | Description |
|---|---|---|
| K | key | The key. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
GetEntries(K)
Gets the System.Collections.Generic.List<T> with the specified key.
Declaration
protected virtual List<T> GetEntries(K key)
Parameters
| Type | Name | Description |
|---|---|---|
| K | key | The chache key |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<T> |
GetEntry(K)
Gets the first cached entry with the specified key.
Declaration
protected virtual T GetEntry(K key)
Parameters
| Type | Name | Description |
|---|---|---|
| K | key | The list index |
Returns
| Type | Description |
|---|---|
| T |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
System.Object.ToString()