MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.basecode.SimpleDictionary Class Reference

The SimpleDictionary is a dictionary used to store a set of key/value pairs, primarily as the DICTIONARY Data Criteria type. More...

Public Types

enum  TYPE { NONE = -1 , STRING = 0 , NUMERIC = 1 , INTEGER = 2 }
 Defines the value type of each element. More...
 

Public Member Functions

 SimpleDictionary ()
 The constructor. More...
 
bool GetType (string strName, out TYPE type)
 Returns the type of a given item. More...
 
double GetNumeric (string strName)
 Returns the numeric value of an item. More...
 
int GetInteger (string strName, int? nDefault=null)
 Returns the integer value of an item. More...
 
string GetString (string strName)
 Returns the string value of an item. More...
 
void Add (string strName, string strVal)
 Add a new string item to the dictionary. More...
 
void Add (string strName, int nVal)
 Add a new integer item to the dictionary. More...
 
void Add (string strName, double dfVal)
 Add a new numeric item to the dictionary. More...
 
List< KeyValuePair< string, object > > ToList ()
 Get the list of values in the dictionary. More...
 
byte[] ToByteArray ()
 Converts the dictionary to a byte array. More...
 
Dictionary< string, double > ToNumericValues (int nCount, string strKey)
 Convert all numeric values into a standard Dictionary. More...
 
Dictionary< string, string > ToStringValues (int nCount, string strKey)
 Convert all string values into a standard Dictionary. More...
 

Static Public Member Functions

static SimpleDictionary FromByteArray (byte[] rg)
 Creates a new dictionary from a byte array. More...
 

Detailed Description

The SimpleDictionary is a dictionary used to store a set of key/value pairs, primarily as the DICTIONARY Data Criteria type.

Definition at line 13 of file SimpleDictionary.cs.

Member Enumeration Documentation

◆ TYPE

Defines the value type of each element.

Enumerator
NONE 

Specifies no type.

STRING 

Specifies a text string value.

NUMERIC 

Specifies a double value.

INTEGER 

Specifies a 32-bit integer value.

Definition at line 21 of file SimpleDictionary.cs.

Constructor & Destructor Documentation

◆ SimpleDictionary()

MyCaffe.basecode.SimpleDictionary.SimpleDictionary ( )

The constructor.

Definition at line 44 of file SimpleDictionary.cs.

Member Function Documentation

◆ Add() [1/3]

void MyCaffe.basecode.SimpleDictionary.Add ( string  strName,
double  dfVal 
)

Add a new numeric item to the dictionary.

Parameters
strNameSpecifies the item name.
dfValSpecifies the item value.

Definition at line 141 of file SimpleDictionary.cs.

◆ Add() [2/3]

void MyCaffe.basecode.SimpleDictionary.Add ( string  strName,
int  nVal 
)

Add a new integer item to the dictionary.

Parameters
strNameSpecifies the item name.
nValSpecifies the item value.

Definition at line 130 of file SimpleDictionary.cs.

◆ Add() [3/3]

void MyCaffe.basecode.SimpleDictionary.Add ( string  strName,
string  strVal 
)

Add a new string item to the dictionary.

Parameters
strNameSpecifies the item name.
strValSpecifies the item value.

Definition at line 119 of file SimpleDictionary.cs.

◆ FromByteArray()

static SimpleDictionary MyCaffe.basecode.SimpleDictionary.FromByteArray ( byte[]  rg)
static

Creates a new dictionary from a byte array.

Parameters
rgSpecifies the byte array to load.
Returns
The new dictionary is returned.

Definition at line 204 of file SimpleDictionary.cs.

◆ GetInteger()

int MyCaffe.basecode.SimpleDictionary.GetInteger ( string  strName,
int?  nDefault = null 
)

Returns the integer value of an item.

Parameters
strNameSpecifies the name of the item to get.
nDefaultSpecifies a default value, which when specified is returned if no value is found.
Returns
The integer value of the item is returned.

Definition at line 85 of file SimpleDictionary.cs.

◆ GetNumeric()

double MyCaffe.basecode.SimpleDictionary.GetNumeric ( string  strName)

Returns the numeric value of an item.

Parameters
strNameSpecifies the name of the item to get.
Returns
The numeric value of the item is returned.

Definition at line 71 of file SimpleDictionary.cs.

◆ GetString()

string MyCaffe.basecode.SimpleDictionary.GetString ( string  strName)

Returns the string value of an item.

Parameters
strNameSpecifies the name of the item to get.
Returns
The string value of the item is returned.

Definition at line 106 of file SimpleDictionary.cs.

◆ GetType()

bool MyCaffe.basecode.SimpleDictionary.GetType ( string  strName,
out TYPE  type 
)

Returns the type of a given item.

Parameters
strNameSpecifies the name of the item.
typeReturns the type of the item, if found in the dictionary.
Returns
If the variable 'strName' exists in the dictionary, true is returned, otherwise false is returned.

Definition at line 54 of file SimpleDictionary.cs.

◆ ToByteArray()

byte[] MyCaffe.basecode.SimpleDictionary.ToByteArray ( )

Converts the dictionary to a byte array.

Returns
The byte array is returned.

Definition at line 160 of file SimpleDictionary.cs.

◆ ToList()

List< KeyValuePair< string, object > > MyCaffe.basecode.SimpleDictionary.ToList ( )

Get the list of values in the dictionary.

Returns
The list of values is returned.

Definition at line 151 of file SimpleDictionary.cs.

◆ ToNumericValues()

Dictionary< string, double > MyCaffe.basecode.SimpleDictionary.ToNumericValues ( int  nCount,
string  strKey 
)

Convert all numeric values into a standard Dictionary.

Parameters
nCountSpecifies the number of numeric values in the SimpleDictionary.
strKeySpecifies the base key used, such as 'A'.
Returns
A Dictionary of string-double pairs is returned.

Definition at line 250 of file SimpleDictionary.cs.

◆ ToStringValues()

Dictionary< string, string > MyCaffe.basecode.SimpleDictionary.ToStringValues ( int  nCount,
string  strKey 
)

Convert all string values into a standard Dictionary.

Parameters
nCountSpecifies the number of string values in the SimpleDictionary.
strKeySpecifies the base key used, such as 'Atx'.
Returns
A Dictionary of string-string pairs is returned.

Definition at line 281 of file SimpleDictionary.cs.


The documentation for this class was generated from the following file: