Class: ObjComparer

Kekule. ObjComparer

new ObjComparer()

A util class to compare Kekule objects through Kekule.ChemObject.compare method.
Source:

Methods

(static) compare(obj1, obj2, options) → {Int}

Compare two objects.
Parameters:
Name Type Description
obj1 Kekule.ChemObj
obj2 Kekule.ChemObj
options Hash Comparison objects, different class may require different options.
For example, you can use {'method': Kekule.ComparisonMethod.CHEM_STRUCTURE} to indicating that only the chem structure data should be compared.
You can also use {'properties': ['propName1', 'propName2']} to manually assign properties that need to be compared.
Custom comparison method can also be appointed as {'customMethod': myComparisonFunc}, then the comparison will be actually called as myComparisonFunc(thisObj, targetObj, options).
Source:
Returns:
Returns 0 when two objects are equivalent, or -1 for "inferior" to obj1 and +1 for "superior" to obj1.
Type
Int

(static) equal(obj1, obj2, options) → {Bool}

Check if two objects are equivalent.
Parameters:
Name Type Description
obj1 Kekule.ChemObj
obj2 Kekule.ChemObj
options Hash Comparison objects, different class may require different options.
For example, you can use {'method': Kekule.ComparisonMethod.CHEM_STRUCTURE} to indicating that only the chem structure data should be compared.
You can also use {'properties': ['propName1', 'propName2']} to manually assign properties that need to be compared.
Custom comparison method can also be appointed as {'customMethod': myComparisonFunc}, then the comparison will be actually called as myComparisonFunc(thisObj, targetObj, options).
Source:
Returns:
Type
Bool