Commit b968bfca authored by Piotr Gawron's avatar Piotr Gawron
Browse files

drug constructor can take another drug as an input

parent c558e399
......@@ -3,19 +3,36 @@
var Annotation = require("./Annotation");
var TargettingStructure = require("./TargettingStructure");
/**
* @typedef {TargettingStructureOptions} DrugOptions
* @property {string[]} brandNames
* @property {Annotation[]} references
* @property {string[]} synonyms
* @property {string} description
* @property {string} bloodBrainBarrier
*/
/**
*
* @param javaObject
* @param {DrugOptions|Drug} javaObject
* @constructor
*/
function Drug(javaObject) {
TargettingStructure.call(this, javaObject);
if (javaObject !== undefined) {
this.setBrandNames(javaObject.brandNames);
this.setReferences(javaObject.references);
this.setSynonyms(javaObject.synonyms);
this.setDescription(javaObject.description);
this.setBloodBrainBarrier(javaObject.bloodBrainBarrier);
if (javaObject instanceof Drug) {
this.setBrandNames(javaObject.getBrandNames());
this.setReferences(javaObject.getReferences());
this.setSynonyms(javaObject.getSynonyms());
this.setDescription(javaObject.getDescription());
this.setBloodBrainBarrier(javaObject.getBloodBrainBarrier());
} else {
this.setBrandNames(javaObject.brandNames);
this.setReferences(javaObject.references);
this.setSynonyms(javaObject.synonyms);
this.setDescription(javaObject.description);
this.setBloodBrainBarrier(javaObject.bloodBrainBarrier);
}
}
}
......
Supports Markdown
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