Class: Element

Element

new Element(symbolOrAtomicNumber)

Represent an element in periodical table.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant Symbol(String) or atomic number(Int) of element.
Properties:
Name Type Description
atomicNumber Int The atomic number of element. Read only.
symbol String The symbol of element. Read only.
name String Name of element. Read only.
group Int Group of element. Read only.
period Int Period of element. Read only.
series String Series of element, e.g. nonmetal.
naturalMass Float Natural mass of element.
Source:

Extends

Members

(static, constant) DEUTERIUM

Label for deuterium.
Source:

(static, constant) DUMMY_ELEMENT

A pseudo element to indicate a dummy atom.
Source:

(static, constant) RGROUP_ELEMENT

A pseudo element to indicate a R-Group
Source:

(static, constant) UNSET_ELEMENT

Indicate the atomic number is unset and this is a unknown element.
Source:

Methods

(static) getTheoreticValence(symbolOrAtomicNumber) → {Int}

Roughly get the theoretic valence of an element. Only consider the group of element. The transitionmetal is not considered and will return null.
Parameters:
Name Type Description
symbolOrAtomicNumber Object
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

(static) getTheoreticValenceOfGroup(group) → {Int}

Roughly get the theoretic valence of an element in a certain group. The transitionmetal is not considered and will return null.
Parameters:
Name Type Description
group Int
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

(static) isAtomicNumberAvailable(atomicNumber) → {Bool}

Check if atomic number is legal in database
Parameters:
Name Type Description
atomicNumber Int
Source:
Returns:
Type
Bool

(static) isDummyElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a dummy element.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isElementSymbolAvailable(atmoicNumber) → {Bool}

Check if element symbol is legal in database.
Parameters:
Name Type Description
atmoicNumber Int
Source:
Returns:
Type
Bool

(static) isNormalElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a normal element (not pseudo one, not unset one).
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isPseudoElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a pseudo element of dummy or RGroup.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isRGroup(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a RGroup
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

appendMarker(marker)

Attach a marker to this object. If marker already exists, nothing will be done.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:

clearMarkers()

Remove all attached markers.
Inherited From:
Source:

fetchMarkerOfType(classType, canCreate, exactMatch, defProps) → {Kekule.ChemObject}

Get attached marker of classType. If no such a marker currently and canCreate is true, a new marker will be created.
Parameters:
Name Type Description
classType Class
canCreate Bool
exactMatch Bool If true, only marker of classType (not its descendants) should be returned.
defProps Hash If create a new marker, those prop values will be applied.
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getElementInfo(symbolOrAtomicNumber)

Get element info of symbolOrAtomicNumber. Support pseudo element.
Parameters:
Name Type Description
symbolOrAtomicNumber Object
Source:

getLabel() → {String}

Returns a string label to represent this element.
Source:
Returns:
Type
String

getMarkerAt(index) → {Kekule.ChemObject}

Get attached marker at index.
Parameters:
Name Type Description
index Int
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getMarkerCount() → {Int}

Return count of attached markers.
Inherited From:
Source:
Returns:
Type
Int

getMarkerOfType(classType, exactMatch) → {Kekule.ChemObject}

Returns the first child marker of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only marker of classType (not its descendants) should be returned.
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getMarkersOfType(classType, exactMatch) → {Array}

Returns all child markers of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only markers of classType (not its descendants) should be returned.
Inherited From:
Source:
Returns:
Type
Array

getTheoreticValence() → {Int}

Roughly get the theoretic valence of an element in a certain group. The transitionmetal is not considered and will return null.
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

getUnplacedMarkers(coordMode) → {Array}

Returns markers that has no coord on coordMode
Parameters:
Name Type Description
coordMode Int
Inherited From:
Source:
Returns:
Type
Array

hasMarker(marker) → {Bool}

Check if a marker has been attached to this object.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:
Returns:
Type
Bool

hasMarkerOfType(classType, exactMatch) → {Bool}

Returns whether there exists child markers of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only markers of classType (not its descendants) should be considered.
Inherited From:
Source:
Returns:
Type
Bool

indexOfMarker(marker) → {Int}

Get index of attached marker in marker array.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:
Returns:
Type
Int

insertMarkerAt(marker, index)

Insert marker to index. If index is not set, marker will be inserted to the tail of the marker array.
Parameters:
Name Type Description
marker Kekule.ChemObject
index Int
Inherited From:
Source:

insertMarkerBefore(marker, refMarker) → {Int}

Insert marker before refMarker in marker list. If refMarker is null or does not exists, marker will be append to tail of list.
Parameters:
Name Type Description
marker Kekule.ChemObject
refMarker Kekule.ChemObject
Inherited From:
Source:
Returns:
Index of obj after inserting.
Type
Int

isAttachedMarker() → {Bool}

Returns whether current object is an attachedMarker of parent object.
Inherited From:
Source:
Returns:
Type
Bool

isDummyElement() → {Bool}

Check if current element is a "dummy" one.
Source:
Returns:
Type
Bool

isHetero() → {Bool}

Returns whether this element is a hetero one (e.g., N, S, Cl...).
Source:
Returns:
Type
Bool

isNormalElement() → {Bool}

Check if this is a normal element (not pseudo one, not unset one).
Source:
Returns:
Type
Bool

isRGroupElement() → {Bool}

Check if this element is used to represent an RGroup
Source:
Returns:
Type
Bool

isSameElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is same with this object.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant Symbol (String) or atomic number (Int) of element.
Source:
Returns:
Type
Bool

removeMarker(marker)

Remove an attached marker.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:

removeMarkerAt(index)

Remove marker at index in attached marker list.
Parameters:
Name Type Description
index Int
Inherited From:
Source:

replaceMarker(oldMarker, newMarker)

Replace oldMarker with new one.
Parameters:
Name Type Description
oldMarker Kekule.ChemObject
newMarker Kekule.ChemObject
Inherited From:
Source:

setMarkerIndex(marker, index)

Change index of marker.
Parameters:
Name Type Description
marker Kekule.ChemObject
index Int
Inherited From:
Source:

Element

new Element(symbolOrAtomicNumber)

Parameters:
Name Type Description
symbolOrAtomicNumber Variant Symbol (String) or atomic number (Int) of element.
Source:

Members

(static, constant) DEUTERIUM

Label for deuterium.
Source:

(static, constant) DUMMY_ELEMENT

A pseudo element to indicate a dummy atom.
Source:

(static, constant) RGROUP_ELEMENT

A pseudo element to indicate a R-Group
Source:

(static, constant) UNSET_ELEMENT

Indicate the atomic number is unset and this is a unknown element.
Source:

Methods

(static) getTheoreticValence(symbolOrAtomicNumber) → {Int}

Roughly get the theoretic valence of an element. Only consider the group of element. The transitionmetal is not considered and will return null.
Parameters:
Name Type Description
symbolOrAtomicNumber Object
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

(static) getTheoreticValenceOfGroup(group) → {Int}

Roughly get the theoretic valence of an element in a certain group. The transitionmetal is not considered and will return null.
Parameters:
Name Type Description
group Int
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

(static) isAtomicNumberAvailable(atomicNumber) → {Bool}

Check if atomic number is legal in database
Parameters:
Name Type Description
atomicNumber Int
Source:
Returns:
Type
Bool

(static) isDummyElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a dummy element.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isElementSymbolAvailable(atmoicNumber) → {Bool}

Check if element symbol is legal in database.
Parameters:
Name Type Description
atmoicNumber Int
Source:
Returns:
Type
Bool

(static) isNormalElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a normal element (not pseudo one, not unset one).
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isPseudoElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a pseudo element of dummy or RGroup.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

(static) isRGroup(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is a RGroup
Parameters:
Name Type Description
symbolOrAtomicNumber Variant
Source:
Returns:
Type
Bool

appendMarker(marker)

Attach a marker to this object. If marker already exists, nothing will be done.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:

clearMarkers()

Remove all attached markers.
Inherited From:
Source:

fetchMarkerOfType(classType, canCreate, exactMatch, defProps) → {Kekule.ChemObject}

Get attached marker of classType. If no such a marker currently and canCreate is true, a new marker will be created.
Parameters:
Name Type Description
classType Class
canCreate Bool
exactMatch Bool If true, only marker of classType (not its descendants) should be returned.
defProps Hash If create a new marker, those prop values will be applied.
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getElementInfo(symbolOrAtomicNumber)

Get element info of symbolOrAtomicNumber. Support pseudo element.
Parameters:
Name Type Description
symbolOrAtomicNumber Object
Source:

getLabel() → {String}

Returns a string label to represent this element.
Source:
Returns:
Type
String

getMarkerAt(index) → {Kekule.ChemObject}

Get attached marker at index.
Parameters:
Name Type Description
index Int
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getMarkerCount() → {Int}

Return count of attached markers.
Inherited From:
Source:
Returns:
Type
Int

getMarkerOfType(classType, exactMatch) → {Kekule.ChemObject}

Returns the first child marker of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only marker of classType (not its descendants) should be returned.
Inherited From:
Source:
Returns:
Type
Kekule.ChemObject

getMarkersOfType(classType, exactMatch) → {Array}

Returns all child markers of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only markers of classType (not its descendants) should be returned.
Inherited From:
Source:
Returns:
Type
Array

getTheoreticValence() → {Int}

Roughly get the theoretic valence of an element in a certain group. The transitionmetal is not considered and will return null.
Source:
Returns:
Theoretic valence or null on transitionmetal.
Type
Int

getUnplacedMarkers(coordMode) → {Array}

Returns markers that has no coord on coordMode
Parameters:
Name Type Description
coordMode Int
Inherited From:
Source:
Returns:
Type
Array

hasMarker(marker) → {Bool}

Check if a marker has been attached to this object.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:
Returns:
Type
Bool

hasMarkerOfType(classType, exactMatch) → {Bool}

Returns whether there exists child markers of a specified class type.
Parameters:
Name Type Description
classType Class
exactMatch Bool If true, only markers of classType (not its descendants) should be considered.
Inherited From:
Source:
Returns:
Type
Bool

indexOfMarker(marker) → {Int}

Get index of attached marker in marker array.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:
Returns:
Type
Int

insertMarkerAt(marker, index)

Insert marker to index. If index is not set, marker will be inserted to the tail of the marker array.
Parameters:
Name Type Description
marker Kekule.ChemObject
index Int
Inherited From:
Source:

insertMarkerBefore(marker, refMarker) → {Int}

Insert marker before refMarker in marker list. If refMarker is null or does not exists, marker will be append to tail of list.
Parameters:
Name Type Description
marker Kekule.ChemObject
refMarker Kekule.ChemObject
Inherited From:
Source:
Returns:
Index of obj after inserting.
Type
Int

isAttachedMarker() → {Bool}

Returns whether current object is an attachedMarker of parent object.
Inherited From:
Source:
Returns:
Type
Bool

isDummyElement() → {Bool}

Check if current element is a "dummy" one.
Source:
Returns:
Type
Bool

isHetero() → {Bool}

Returns whether this element is a hetero one (e.g., N, S, Cl...).
Source:
Returns:
Type
Bool

isNormalElement() → {Bool}

Check if this is a normal element (not pseudo one, not unset one).
Source:
Returns:
Type
Bool

isRGroupElement() → {Bool}

Check if this element is used to represent an RGroup
Source:
Returns:
Type
Bool

isSameElement(symbolOrAtomicNumber) → {Bool}

Check if symbolOrAtomicNumber is same with this object.
Parameters:
Name Type Description
symbolOrAtomicNumber Variant Symbol (String) or atomic number (Int) of element.
Source:
Returns:
Type
Bool

removeMarker(marker)

Remove an attached marker.
Parameters:
Name Type Description
marker Kekule.ChemObject
Inherited From:
Source:

removeMarkerAt(index)

Remove marker at index in attached marker list.
Parameters:
Name Type Description
index Int
Inherited From:
Source:

replaceMarker(oldMarker, newMarker)

Replace oldMarker with new one.
Parameters:
Name Type Description
oldMarker Kekule.ChemObject
newMarker Kekule.ChemObject
Inherited From:
Source:

setMarkerIndex(marker, index)

Change index of marker.
Parameters:
Name Type Description
marker Kekule.ChemObject
index Int
Inherited From:
Source: