IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Physics.ChemicalCompound Class Reference

Chemical compoind. More...

Public Member Functions

 ChemicalCompound (params ChemicalElementQuantity[] elementQuantities)
 Constructs a new chemical compound that consists of the specified stoichiometric quantities of elements listed in the specified order. More...
 
 ChemicalCompound (ChemicalElements el1, int q1)
 Construct a chemical compound containing the specified element with corresponding stoichiometric number. More...
 
 ChemicalCompound (ChemicalElements el1, int q1, ChemicalElements el2, int q2, ChemicalElements el3, int q3, ChemicalElements el4, int q4, ChemicalElements el5, int q5)
 Construct a chemical compound containing the specified 5 elements with corresponding stoichiometric numbers. More...
 
 ChemicalCompound (ChemicalElements el1, int q1, ChemicalElements el2, int q2, ChemicalElements el3, int q3, ChemicalElements el4, int q4, ChemicalElements el5, int q5, ChemicalElements el6, int q6, ChemicalElements el7, int q7, ChemicalElements el8, int q8, ChemicalElements el9, int q9, ChemicalElements el10, int q10)
 Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers. More...
 
 ChemicalCompound (ChemicalElement el1, int q1)
 Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers. More...
 
 ChemicalCompound (ChemicalElement el1, int q1, ChemicalElement el2, int q2, ChemicalElement el3, int q3, ChemicalElement el4, int q4, ChemicalElement el5, int q5)
 Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers. More...
 
 ChemicalCompound (ChemicalElement el1, int q1, ChemicalElement el2, int q2, ChemicalElement el3, int q3, ChemicalElement el4, int q4, ChemicalElement el5, int q5, ChemicalElement el6, int q6, ChemicalElement el7, int q7, ChemicalElement el8, int q8, ChemicalElement el9, int q9, ChemicalElement el10, int q10)
 Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers. More...
 
ChemicalElementQuantity[] GetElements ()
 Returns an array of chemical elements with stoichiometric numbers that form the current chemical compound. More...
 
void ClearElements ()
 Clears the list of elements with stoichiometric quantities that form the compound. More...
 
void AddElement (ChemicalElementQuantity el)
 Adds the specified element with stoichiometric quantity to the list defining the compound. More...
 
void AddElements (params ChemicalElementQuantity[] chemicalElements)
 Adds the specified elements with stoichiometric quantities to the list defining the compound. More...
 
void RemoveElement (ChemicalElementQuantity el)
 Removes the specified element with stoichiometric quantity to the list defining the compound. More...
 
void RemoveElement (ChemicalElements whichElement)
 Removes the chemical element specified by the ChemicalElements enumerator from the list of elements forming the compound. More...
 
void RemoveElement (string elementSymbolOrName)
 Removes the element with either the specified name or symbol from the list of elements forming the compound. More...
 
int GetElementIndex (ChemicalElements whichElement)
 Returns index of the specified element (defined by the ChemicalElements enumerator) on the list of elements forming the chemical compound, or a negative number if there is no matching element on the list. More...
 
int GetElementIndex (string elementSymbolOrName)
 Returns index of the element with the specified name or symbol on the list of elements forming the chemical compound, or a negative number if there is no matching element on the list. More...
 
ChemicalElementQuantity GetElement (ChemicalElements whichElement)
 Returns the chemical element quantity from the list of elements that form the compound that match the specified chemical element enumerator of type ChemicalElements, or null if there is no matchig element. More...
 
ChemicalElementQuantity GetElement (string elementSymbolOrName)
 Returns the chemical element with stoichiometric quantity from the list of elements that form the compound that match the specified element symbol or name, or null if there is no matchig element. More...
 

Protected Attributes

List< ChemicalElementQuantity_elements = new List<ChemicalElementQuantity>()
 List of chemical elements with stoichiometric quantities that form the chemical compound. More...
 

Properties

int NumElements [get]
 Gets the number of elements in the chemical compound. More...
 

Detailed Description

Chemical compoind.

Consists of a list of chemical elements with quantities.

$A Igor Nov08;

Constructor & Destructor Documentation

IG.Physics.ChemicalCompound.ChemicalCompound ( params ChemicalElementQuantity[]  elementQuantities)
inline

Constructs a new chemical compound that consists of the specified stoichiometric quantities of elements listed in the specified order.

Parameters
elementQuantities
IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElements  el1,
int  q1 
)
inline

Construct a chemical compound containing the specified element with corresponding stoichiometric number.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

References IG.Lib.None.

IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElements  el1,
int  q1,
ChemicalElements  el2,
int  q2,
ChemicalElements  el3,
int  q3,
ChemicalElements  el4,
int  q4,
ChemicalElements  el5,
int  q5 
)
inline

Construct a chemical compound containing the specified 5 elements with corresponding stoichiometric numbers.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

References IG.Lib.None.

IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElements  el1,
int  q1,
ChemicalElements  el2,
int  q2,
ChemicalElements  el3,
int  q3,
ChemicalElements  el4,
int  q4,
ChemicalElements  el5,
int  q5,
ChemicalElements  el6,
int  q6,
ChemicalElements  el7,
int  q7,
ChemicalElements  el8,
int  q8,
ChemicalElements  el9,
int  q9,
ChemicalElements  el10,
int  q10 
)
inline

Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElement  el1,
int  q1 
)
inline

Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElement  el1,
int  q1,
ChemicalElement  el2,
int  q2,
ChemicalElement  el3,
int  q3,
ChemicalElement  el4,
int  q4,
ChemicalElement  el5,
int  q5 
)
inline

Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

IG.Physics.ChemicalCompound.ChemicalCompound ( ChemicalElement  el1,
int  q1,
ChemicalElement  el2,
int  q2,
ChemicalElement  el3,
int  q3,
ChemicalElement  el4,
int  q4,
ChemicalElement  el5,
int  q5,
ChemicalElement  el6,
int  q6,
ChemicalElement  el7,
int  q7,
ChemicalElement  el8,
int  q8,
ChemicalElement  el9,
int  q9,
ChemicalElement  el10,
int  q10 
)
inline

Construct a chemical compound containing the specified 10 elements with corresponding stoichiometric numbers.

Elements and corresponding stoichiometric numbers are specified in alternating order - first element, first st. number, second element, second number, etc.

Only elements that are defined and have stoichiometric numbers greater thatn 0 are added.

Member Function Documentation

ChemicalElementQuantity [] IG.Physics.ChemicalCompound.GetElements ( )
inline

Returns an array of chemical elements with stoichiometric numbers that form the current chemical compound.

Referenced by ChemicalCompoundDto.CopyFromPlain().

void IG.Physics.ChemicalCompound.ClearElements ( )
inline

Clears the list of elements with stoichiometric quantities that form the compound.

void IG.Physics.ChemicalCompound.AddElement ( ChemicalElementQuantity  el)
inline

Adds the specified element with stoichiometric quantity to the list defining the compound.

Parameters
elElement to be added.
void IG.Physics.ChemicalCompound.AddElements ( params ChemicalElementQuantity[]  chemicalElements)
inline

Adds the specified elements with stoichiometric quantities to the list defining the compound.

Parameters
elElements to be added.
void IG.Physics.ChemicalCompound.RemoveElement ( ChemicalElementQuantity  el)
inline

Removes the specified element with stoichiometric quantity to the list defining the compound.

Parameters
elElement to be removed.
void IG.Physics.ChemicalCompound.RemoveElement ( ChemicalElements  whichElement)
inline

Removes the chemical element specified by the ChemicalElements enumerator from the list of elements forming the compound.

Parameters
whichElementSpecifies the element to be removed.
void IG.Physics.ChemicalCompound.RemoveElement ( string  elementSymbolOrName)
inline

Removes the element with either the specified name or symbol from the list of elements forming the compound.

Parameters
elementSymbolOrNameSymbol or name (any ofthose two is valid) of the chemical element to be removed.
int IG.Physics.ChemicalCompound.GetElementIndex ( ChemicalElements  whichElement)
inline

Returns index of the specified element (defined by the ChemicalElements enumerator) on the list of elements forming the chemical compound, or a negative number if there is no matching element on the list.

Parameters
whichElementEnumerator of type ChemicalElements that specifies the element whose index is returned.
Returns
Index of the matching element, or a negative number if there is no matching element.

References IG.Physics.ChemicalElement.Element.

int IG.Physics.ChemicalCompound.GetElementIndex ( string  elementSymbolOrName)
inline

Returns index of the element with the specified name or symbol on the list of elements forming the chemical compound, or a negative number if there is no matching element on the list.

Parameters
elementSymbolOrNameEither symbol of name of the element whose index is returned (both are acceptable).
Returns
Index of the matching element, or a negative number if there is no matching element.

References IG.Physics.ChemicalElement.Name, and IG.Physics.ChemicalElement.Symbol.

ChemicalElementQuantity IG.Physics.ChemicalCompound.GetElement ( ChemicalElements  whichElement)
inline

Returns the chemical element quantity from the list of elements that form the compound that match the specified chemical element enumerator of type ChemicalElements, or null if there is no matchig element.

Parameters
whichElementEnumerator of type ChemicalElements that defines which element with stoichiometric quantity is to be returned.
Returns
Matching element from the list of elements that form the compound, or null if there is no such element in the compound.
ChemicalElementQuantity IG.Physics.ChemicalCompound.GetElement ( string  elementSymbolOrName)
inline

Returns the chemical element with stoichiometric quantity from the list of elements that form the compound that match the specified element symbol or name, or null if there is no matchig element.

Parameters
whichElementSymbol or name of the element to be returned (both are accepted).

If null or empty string then null is returned.

Returns
Matching element from the list of elements that form the compound, or null if there is no such element in the compound.

Member Data Documentation

List<ChemicalElementQuantity> IG.Physics.ChemicalCompound._elements = new List<ChemicalElementQuantity>()
protected

List of chemical elements with stoichiometric quantities that form the chemical compound.

Order of elements matters as it is used for printing the compound's molecular formula.

Property Documentation

int IG.Physics.ChemicalCompound.NumElements
get

Gets the number of elements in the chemical compound.

Referenced by ChemicalCompoundDto.CopyFromPlain().


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