Class Map
A ordered map of
Inherited Members
Namespace: IPA.Config.Data
Assembly: IPA.Loader.dll
Syntax
public sealed class Map : Value
Properties
| Improve this Doc View SourceCount
Gets the number of key-value pairs in this Map.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[String]
Accesses the Value at key
in the map.
Declaration
public Value this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to get the value associated with |
Property Value
Type | Description |
---|---|
Value | the value associated with the |
Keys
Gets a collection of the keys for the Map.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<String> |
Values
Gets a collection of the values in the Map.
Declaration
public ICollection<Value> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<Value> |
Remarks
Unlike all other iterables given by Map, this does not guarantee that order is maintained.
Methods
| Improve this Doc View SourceAdd(String, Value)
Adds a new Value with a given key.
Declaration
public void Add(string key, Value value)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to put the value at |
Value | value | the Value to add |
Clear()
Clears the Map of its key-value pairs.
Declaration
public void Clear()
ContainsKey(String)
Checks if the Map contains a given key
.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to check for |
Returns
Type | Description |
---|---|
Boolean | true if the key exists, otherwise false |
GetEnumerator()
Enumerates the Map's key-value pairs.
Declaration
public IEnumerator<KeyValuePair<string, Value>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<String, Value>> | an |
Remove(String)
Removes the object associated with a key in this Map.
Declaration
public bool Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to remove |
Returns
Type | Description |
---|---|
Boolean | true if the key existed, false otherwise |
ToString()
Converts this Value into a human-readable format.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | a JSON-like set of key-value pairs |
Overrides
| Improve this Doc View SourceTryGetValue(String, out Value)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(string key, out Value value)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key of the value to get |
Value | value | the target location of the retrieved object |
Returns
Type | Description |
---|---|
Boolean | true if the key was found and |