Commit 7aa060dc authored by Piotr Gawron's avatar Piotr Gawron
Browse files

object constructor can take as a parameter object of the same class

parent b968bfca
......@@ -3,20 +3,38 @@
var Annotation = require("./Annotation");
var TargettingStructure = require("./TargettingStructure");
/**
* @typedef {TargettingStructureOptions} ChemicalOptions
* @property {Annotation[]} references
* @property {string[]} synonyms
* @property {string} description
* @property {string} directEvidence
* @property {Annotation[]} directEvidenceReferences
*/
/**
*
* @param javaObject
* @param {ChemicalOptions|Chemical} javaObject
* @constructor
*/
function Chemical(javaObject) {
TargettingStructure.call(this, javaObject);
if (javaObject !== undefined) {
this.setReferences(javaObject.references);
this.setDescription(javaObject.description);
this.setSynonyms(javaObject.synonyms);
this.setDirectEvidence(javaObject.directEvidence);
this.setDirectEvidenceReferences(javaObject.directEvidenceReferences);
if (javaObject instanceof Chemical) {
this.setReferences(javaObject.getReferences());
this.setDescription(javaObject.getDescription());
this.setSynonyms(javaObject.getSynonyms());
this.setDirectEvidence(javaObject.getDirectEvidence());
this.setDirectEvidenceReferences(javaObject.getDirectEvidenceReferences());
} else {
this.setReferences(javaObject.references);
this.setDescription(javaObject.description);
this.setSynonyms(javaObject.synonyms);
this.setDirectEvidence(javaObject.directEvidence);
this.setDirectEvidenceReferences(javaObject.directEvidenceReferences);
}
}
}
......
......@@ -2,9 +2,13 @@
var TargettingStructure = require("./TargettingStructure");
/**
* @typedef {TargettingStructureOptions} MiRnaOptions
*/
/**
*
* @param javaObject
* @param {MiRnaOptions|MiRna} javaObject
* @constructor
* @extends TargettingStructure
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment