Class NpzDictionary<T>
Lazily-loaded collection of arrays from a compressed .npz archive.
Implements
Namespace: ISynergy.Framework.Mathematics.IO.NumPy
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public class NpzDictionary<T> : IDisposable where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable
Type Parameters
Name | Description |
---|---|
T | The type of the arrays to be loaded. |
Constructors
View SourceNpzDictionary(Stream)
Initializes a new instance of the NpzDictionary<T> class.
Declaration
public NpzDictionary(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream from where the arrays should be loaded from. |
Properties
View SourceCount
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The count. |
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsSynchronized
Gets a value indicating whether the access to collection is synchronized (thread-safe).
Declaration
public bool IsSynchronized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[String]
Gets the array stored under the given key.
Declaration
public T this[string key] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Property Value
Type | Description |
---|---|
T |
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
Declaration
public IEnumerable<string> Keys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.String> | The keys. |
SyncRoot
Gets an object that can be used to synchronize access to the collection.
Declaration
public object SyncRoot { get; }
Property Value
Type | Description |
---|---|
System.Object |
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
Declaration
public IEnumerable<T> Values { get; }
Property Value
Type | Description |
---|---|
IEnumerable<T> | The values. |
Methods
View SourceAdd(T)
Throws a
Declaration
public void Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Clear()
Throws a
Declaration
public void Clear()
Contains(T)
Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.
Declaration
public bool Contains(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to locate in the System.Collections.Generic.ICollection<T>. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
ContainsKey(String)
Determines whether the read-only dictionary contains an element that has the specified key.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to locate. |
Returns
Type | Description |
---|---|
System.Boolean | true if the read-only dictionary contains an element that has the specified key; otherwise, false. |
CopyTo(T[], Int32)
Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing. |
System.Int32 | arrayIndex | The zero-based index in |
CopyTo(Array, Int32)
Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(Array array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
Array | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing. |
System.Int32 | arrayIndex | The zero-based index in |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<string, T>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<System.String, T>> | An enumerator that can be used to iterate through the collection. |
Load(Stream)
Loads the array from the specified stream.
Declaration
protected virtual T Load(Stream s)
Parameters
Type | Name | Description |
---|---|---|
Stream | s |
Returns
Type | Description |
---|---|
T |
Remove(T)
Throws a
Declaration
public bool Remove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetValue(String, out T)
Gets the value that is associated with the specified key.
Declaration
public bool TryGetValue(string key, out T value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to locate. |
T | value | When this method returns, the value associated with the specified key, if the key is found;
otherwise, the default value for the type of the |
Returns
Type | Description |
---|---|
System.Boolean | true if the object that implements the System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false. |