IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Collection of fields of the same type. Fields are identified by their names. More...
Public Member Functions | |
FieldCollection () | |
Constructor. More... | |
virtual TField | CreateField (int numElements, string name, string description) |
Creates a new field of specified length and with specified name and description (the latter two can be null). More... | |
string[] | GetFieldNames () |
Returns names of all the fields contained in the current field collection. More... | |
virtual void | AddField (int numElements, string fieldName, string fieldDescription) |
Creates a new field of the specified length and adds it to the current collection. More... | |
void | AddField (TField field, string name) |
Adds the specified to the collection under a specified name. More... | |
void | AddField (TField field) |
Adds the specified field to the urrent field collection. More... | |
void | RemoveField (string fieldName) |
Removed the field with the specified name from the current field collection. More... | |
Public Attributes | |
const string | DefaultFieldNameConst = "default" |
Protected Member Functions | |
void | NullifyActiveField () |
Sets the variable holding currently active field to null. More... | |
Properties | |
string | DefauletFieldName [get] |
Gets name that is used for automatically created fields. More... | |
SortedList< string, TField > | Fields [get] |
string | ActiveFieldName [get, set] |
Gets or sets name of the active field. More... | |
TField | ActiveField [get] |
Gets the currently active field. More... | |
TField | this[string fieldName] [get] |
Gets the field that has a specified name. More... | |
TField | this[int index] [get] |
Get the field that corresponds to the specified index. More... | |
int | Count [get] |
Gets the number of fields contained in the collection. More... | |
Private Attributes | |
SortedList< string, TField > | _fields = new SortedList<string, TField>() |
string | _activeFieldName |
TField | _activeField |
Collection of fields of the same type. Fields are identified by their names.
In principle, contained fields can be of different dimensions.
TField | Type of fields contained in the collection. |
TElement | Type of elements of the fields that can be contained in the collection. |
Completely generic definition was introduced in 2009. Before that, several types were used for specific field collections.
$A Igor Apr09;
TField | : | Field<TElement> | |
TField | : | new() |
|
inline |
Constructor.
|
inlinevirtual |
Creates a new field of specified length and with specified name and description (the latter two can be null).
numElements | Field length (number of elements). |
name | Field name (can be null). |
description | Description of the field (can be null). |
Reimplemented in IG.Num.FieldCollection2d< TField, TElement >, and IG.Num.FieldCollection3d< TField, TElement >.
|
inlineprotected |
Sets the variable holding currently active field to null.
If active field name is specified then active field will still be correctly obtained (lazy evaluation).
|
inline |
Returns names of all the fields contained in the current field collection.
|
inlinevirtual |
Creates a new field of the specified length and adds it to the current collection.
numElements | Length of the field that is created and added (number of elements). |
fieldName | Name of the field. In principle, it should be different tan null. |
fieldDescription | Optional description of the field. It can be null. |
Reimplemented in IG.Num.FieldCollection2d< TField, TElement >, and IG.Num.FieldCollection3d< TField, TElement >.
|
inline |
Adds the specified to the collection under a specified name.
If the field already has a name then its name is replaced by the specified name, unlsee the specified name is null.
field | Field to be added to the collection. |
name | Name under which the field is added to the current collection. |
|
inline |
Adds the specified field to the urrent field collection.
field | Field to be added. |
|
inline |
Removed the field with the specified name from the current field collection.
fieldName | Name of the field to be removed. |
const string IG.Num.FieldCollection< TField, TElement >.DefaultFieldNameConst = "default" |
|
private |
|
private |
|
private |
|
get |
Gets name that is used for automatically created fields.
|
getprotected |
|
getset |
Gets or sets name of the active field.
Active field will be accessed throughthe ActiveField property. When setting name of the active field, that property is not assigned, but it gets assigned on the first get access.
|
get |
Gets the currently active field.
|
get |
Gets the field that has a specified name.
fieldName | Name of the field to be returned. |
|
get |
Get the field that corresponds to the specified index.
This is seldom used, usually fields will be accessed through field names.
Warning: when adding fields, index of a field may change, therefore this kind of access should only be used wen there is no adding or removing of fields.
index | Index of the field. |
|
get |
Gets the number of fields contained in the collection.