Class AssetDictionary<TKey, TValue>
A dictionary class supporting non-unique keys
Implements
Inherited Members
Namespace: AssetRipper.Assets.Generics
Assembly: AssetRipper.Assets.dll
Syntax
public sealed class AssetDictionary<TKey, TValue> : AccessDictionaryBase<TKey, TValue> where TKey : new()
where TValue : new()
Type Parameters
Name | Description |
---|---|
TKey | The type of the keys in the dictionary. |
TValue | The type of the values in the dictionary. |
Constructors
| Improve this Doc View SourceAssetDictionary()
Declaration
public AssetDictionary()
AssetDictionary(Int32)
Declaration
public AssetDictionary(int capacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity |
Properties
| Improve this Doc View SourceCapacity
The capacity of the dictionary
Declaration
public override int Capacity { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Count
The number of pairs in the dictionary
Declaration
public override int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Methods
| Improve this Doc View SourceAdd(TKey, TValue)
Add a pair to the dictionary
Declaration
public override void Add(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to be added |
TValue | value | The value to be added |
Overrides
Remarks
This method is not necessarily type safe. It could throw exceptions if used improperly.
AddNew()
Add a new pair to the dictionary
Declaration
public override AssetPair<TKey, TValue> AddNew()
Returns
Type | Description |
---|---|
AssetPair<TKey, TValue> |
Overrides
Clear()
Declaration
public override void Clear()
Overrides
EnsureCapacity(Int32)
Ensures that the capacity of this list is at least the specified capacity
.
If the current capacity of the list is less than specified capacity
,
the capacity is increased by continuously twice current capacity until it is at least the specified capacity
.
Declaration
public int EnsureCapacity(int capacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | The minimum capacity to ensure. |
Returns
Type | Description |
---|---|
System.Int32 | The new capacity of this list. |
GetEnumerator()
Declaration
public override IEnumerator<AssetPair<TKey, TValue>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<AssetPair<TKey, TValue>> |
Overrides
GetKey(Int32)
Get a key in the dictionary
Declaration
public override TKey GetKey(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to access |
Returns
Type | Description |
---|---|
TKey | The key at the specified index |
Overrides
GetPair(Int32)
Declaration
public override AssetPair<TKey, TValue> GetPair(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type | Description |
---|---|
AssetPair<TKey, TValue> |
Overrides
GetValue(Int32)
Get a value in the dictionary
Declaration
public override TValue GetValue(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to access |
Returns
Type | Description |
---|---|
TValue | The value at the specified index |
Overrides
RemoveAt(Int32)
Declaration
public override void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Overrides
SetKey(Int32, TKey)
Set a key in the dictionary
Declaration
public override void SetKey(int index, TKey newKey)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to access |
TKey | newKey | The new key to be assigned |
Overrides
Remarks
This method is not necessarily type safe. It could throw exceptions if used improperly.
SetValue(Int32, TValue)
Set a value in the dictionary
Declaration
public override void SetValue(int index, TValue newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to access |
TValue | newValue | The new value to be assigned |
Overrides
Remarks
This method is not necessarily type safe. It could throw exceptions if used improperly.
TryGetSinglePairForKey(TKey, out AccessPairBase<TKey, TValue>)
Declaration
public override bool TryGetSinglePairForKey(TKey key, out AccessPairBase<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | |
AccessPairBase<TKey, TValue> | pair |
Returns
Type | Description |
---|---|
System.Boolean |