diff --git a/frontend-js/src/main/js/gui/leftPanel/DrugPanel.js b/frontend-js/src/main/js/gui/leftPanel/DrugPanel.js index 0d7b10cbb01e3e457b5c49d1eaab7cb2a8f65570..f41ef4b34f11402e21e23eb7ffcc982e39004f29 100644 --- a/frontend-js/src/main/js/gui/leftPanel/DrugPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/DrugPanel.js @@ -28,6 +28,11 @@ function DrugPanel(params) { DrugPanel.prototype = Object.create(AbstractDbPanel.prototype); DrugPanel.prototype.constructor = DrugPanel; +/** + * + * @param {Drug} drug + * @returns {HTMLDivElement} + */ DrugPanel.prototype.createPreamble = function (drug) { var self = this; var guiUtils = self.getGuiUtils(); diff --git a/frontend-js/src/main/js/map/data/Annotation.js b/frontend-js/src/main/js/map/data/Annotation.js index 4eebe44e9b6c5257767dc0a58d041f25744e312f..748eff92445c3ccd2e9bc33a806652a206279760 100644 --- a/frontend-js/src/main/js/map/data/Annotation.js +++ b/frontend-js/src/main/js/map/data/Annotation.js @@ -7,6 +7,21 @@ var Article = require("./Article"); // noinspection JSUnusedLocalSymbols var logger = require('../../logger'); +/** + * @typedef {Object} AnnotationOptions + * @property {string} link + * @property {number} id + * @property {Article|ArticleOptions} article + * @property {string} type + * @property {string} resource + * @property {string} annotatorClassName + */ + +/** + * + * @param {AnnotationOptions|Annotation} javaObject + * @constructor + */ function Annotation(javaObject) { if (javaObject instanceof Annotation) { this.setLink(javaObject.getLink()); @@ -29,57 +44,105 @@ function Annotation(javaObject) { } } -Annotation.prototype.setLink = function(link) { +/** + * + * @param {string} link + */ +Annotation.prototype.setLink = function (link) { this._link = link; }; -Annotation.prototype.getLink = function() { +/** + * + * @returns {string} + */ +Annotation.prototype.getLink = function () { return this._link; }; -Annotation.prototype.setId = function(id) { +/** + * + * @param {number} id + */ +Annotation.prototype.setId = function (id) { this._id = id; }; -Annotation.prototype.getId = function() { +/** + * + * @returns {number} + */ +Annotation.prototype.getId = function () { return this._id; }; -Annotation.prototype.setResource = function(resource) { +/** + * + * @param {string} resource + */ +Annotation.prototype.setResource = function (resource) { if (resource === undefined) { throw new Error("resource cannot be undefined"); } this._resource = resource; }; -Annotation.prototype.getResource = function() { +/** + * + * @returns {string} + */ +Annotation.prototype.getResource = function () { return this._resource; }; -Annotation.prototype.setType = function(type) { +/** + * + * @param {string} type + */ +Annotation.prototype.setType = function (type) { if (type === undefined) { throw new Error("type cannot be undefined"); } this._type = type; }; -Annotation.prototype.getType = function() { +/** + * + * @returns {string} + */ +Annotation.prototype.getType = function () { return this._type; }; -Annotation.prototype.setArticle = function(article) { +/** + * + * @param {Article} article + */ +Annotation.prototype.setArticle = function (article) { this._article = article; }; -Annotation.prototype.getArticle = function() { +/** + * + * @returns {Article} + */ +Annotation.prototype.getArticle = function () { return this._article; }; -Annotation.prototype.setAnnotatorClassName = function(annotatorClassName) { +/** + * + * @param {string} annotatorClassName + */ +Annotation.prototype.setAnnotatorClassName = function (annotatorClassName) { this._annotatorClassName = annotatorClassName; }; -Annotation.prototype.getAnnotatorClassName = function() { +/** + * + * @returns {string} + */ +Annotation.prototype.getAnnotatorClassName = function () { return this._annotatorClassName; }; diff --git a/frontend-js/src/main/js/map/data/Article.js b/frontend-js/src/main/js/map/data/Article.js index 5b2e64734a6edd8a811c1766e3b66800291d6f94..584cd35a1eff35bd56791234b8cb3decd78c4336 100644 --- a/frontend-js/src/main/js/map/data/Article.js +++ b/frontend-js/src/main/js/map/data/Article.js @@ -1,5 +1,21 @@ "use strict"; +/** + * @typedef {Object} ArticleOptions + * @property {string} title + * @property {string[]} authors + * @property {string} journal + * @property {number} year + * @property {string} link + * @property {number} citationCount + * @property {string} id + */ + +/** + * + * @param {Article|ArticleOptions} javaObject + * @constructor + */ function Article(javaObject) { if (javaObject instanceof Article) { this.setTitle(javaObject.getTitle()); @@ -20,62 +36,123 @@ function Article(javaObject) { } } -Article.prototype.setTitle = function(title) { +/** + * + * @param {string} title + */ +Article.prototype.setTitle = function (title) { this._title = title; }; -Article.prototype.getTitle = function() { +/** + * + * @returns {string} + */ +Article.prototype.getTitle = function () { return this._title; }; -Article.prototype.setId = function(id) { +/** + * + * @param {string} id + */ +Article.prototype.setId = function (id) { this._id = id; }; -Article.prototype.getAuthors = function() { +/** + * + * @returns {string[]} + */ +Article.prototype.getAuthors = function () { return this._authors; }; -Article.prototype.setAuthors = function(authors) { + +/** + * + * @param {string[]} authors + */ +Article.prototype.setAuthors = function (authors) { this._authors = authors; }; -Article.prototype.setId = function(id) { +/** + * + * @param {string} id + */ +Article.prototype.setId = function (id) { this._id = id; }; -Article.prototype.getId = function() { +/** + * + * @returns {string} + */ +Article.prototype.getId = function () { return this._id; }; -Article.prototype.setJournal = function(journal) { +/** + * + * @param {string} journal + */ +Article.prototype.setJournal = function (journal) { this._journal = journal; }; -Article.prototype.getJournal = function() { +/** + * + * @returns {string} + */ +Article.prototype.getJournal = function () { return this._journal; }; -Article.prototype.setYear = function(year) { +/** + * + * @param {number} year + */ +Article.prototype.setYear = function (year) { this._year = year; }; -Article.prototype.getYear = function() { +/** + * + * @returns {number} + */ +Article.prototype.getYear = function () { return this._year; }; -Article.prototype.setLink = function(link) { +/** + * + * @param {string} link + */ +Article.prototype.setLink = function (link) { this._link = link; }; -Article.prototype.getLink = function() { +/** + * + * @returns {string} + */ +Article.prototype.getLink = function () { return this._link; }; -Article.prototype.setCitationCount = function(citationCount) { +/** + * + * @param {number} citationCount + */ +Article.prototype.setCitationCount = function (citationCount) { this._citationCount = citationCount; }; -Article.prototype.getCitationCount = function() { +/** + * + * @returns {number} + */ +Article.prototype.getCitationCount = function () { return this._citationCount; }; diff --git a/frontend-js/src/main/js/map/data/BioEntity.js b/frontend-js/src/main/js/map/data/BioEntity.js index adad932ef3936926039142b39f9e7f90314341d9..f5e5a8370645e2cff368bca1356317948e9aafb5 100644 --- a/frontend-js/src/main/js/map/data/BioEntity.js +++ b/frontend-js/src/main/js/map/data/BioEntity.js @@ -10,10 +10,18 @@ var Annotation = require("./Annotation"); function BioEntity() { } +/** + * + * @returns {number} + */ BioEntity.prototype.getLinkedSubmodelId = function() { return this._linkedSubmodelId; }; +/** + * + * @param {number} linkedSubmodelId + */ BioEntity.prototype.setLinkedSubmodelId = function(linkedSubmodelId) { this._linkedSubmodelId = linkedSubmodelId; }; @@ -44,58 +52,114 @@ BioEntity.prototype.getModelId = function() { return this._modelId; }; +/** + * + * @param {number} modelId + */ BioEntity.prototype.setModelId = function(modelId) { this._modelId = modelId; }; +/** + * + * @returns {boolean} + */ BioEntity.prototype.isComplete = function() { return this._complete; }; +/** + * + * @param {boolean} complete + */ BioEntity.prototype.setIsComplete = function(complete) { this._complete = complete; }; +/** + * + * @returns {string} + */ BioEntity.prototype.getSymbol = function() { return this.symbol; }; +/** + * + * @param {string} symbol + */ BioEntity.prototype.setSymbol = function(symbol) { this.symbol = symbol; }; +/** + * + * @returns {string} + */ BioEntity.prototype.getAbbreviation = function() { return this._abbreviation; }; +/** + * + * @param {string} abbreviation + */ BioEntity.prototype.setAbbreviation = function(abbreviation) { this._abbreviation = abbreviation; }; +/** + * + * @returns {string} + */ BioEntity.prototype.getFormula = function() { return this._formula; }; +/** + * + * @param {string} formula + */ BioEntity.prototype.setFormula = function(formula) { this._formula = formula; }; +/** + * + * @param {string[]} synonyms + */ BioEntity.prototype.setSynonyms = function(synonyms) { this._synonyms = synonyms; }; +/** + * + * @returns {string[]} + */ BioEntity.prototype.getSynonyms = function() { return this._synonyms; }; +/** + * + * @param {string} description + */ BioEntity.prototype.setDescription = function(description) { this._description = description; }; +/** + * + * @returns {string} + */ BioEntity.prototype.getDescription = function() { return this._description; }; +/** + * + * @param {string} type + */ BioEntity.prototype.setType = function(type) { if (type === undefined) { throw new Error("type cannot be undefined"); @@ -103,32 +167,61 @@ BioEntity.prototype.setType = function(type) { this._type = type; }; +/** + * + * @returns {string} + */ BioEntity.prototype.getType = function() { return this._type; }; +/** + * + * @param {string} type + * @returns {Object} + */ BioEntity.prototype.getOther = function(type) { if (this._other !== undefined) { return (type === undefined) ? this._other : this._other[type]; } }; +/** + * + * @param {Object} other + */ BioEntity.prototype.setOther = function(other) { this._other = other; }; +/** + * + * @returns {number} + */ BioEntity.prototype.getHierarchyVisibilityLevel = function() { return this._hierarchyVisibilityLevel; }; +/** + * + * @param {number} hierarchyVisibilityLevel + */ BioEntity.prototype.setHierarchyVisibilityLevel = function(hierarchyVisibilityLevel) { this._hierarchyVisibilityLevel = hierarchyVisibilityLevel; }; +/** + * + * @returns {Annotation[]} + */ BioEntity.prototype.getReferences = function() { return this.references; }; +/** + * + * @param {Annotation[]} references + */ BioEntity.prototype.setReferences = function(references) { if (references=== undefined) { throw new Error("references must be defined"); diff --git a/frontend-js/src/main/js/map/data/Chemical.js b/frontend-js/src/main/js/map/data/Chemical.js index 22609e10ce51a0e197f07143beb40cbadd84d6bb..b81080341613ea28776fca293cfeea911c381cc5 100644 --- a/frontend-js/src/main/js/map/data/Chemical.js +++ b/frontend-js/src/main/js/map/data/Chemical.js @@ -3,6 +3,11 @@ var Annotation = require("./Annotation"); var TargettingStructure = require("./TargettingStructure"); +/** + * + * @param javaObject + * @constructor + */ function Chemical(javaObject) { TargettingStructure.call(this, javaObject); if (javaObject !== undefined) { @@ -18,66 +23,91 @@ function Chemical(javaObject) { Chemical.prototype = Object.create(TargettingStructure.prototype); Chemical.prototype.constructor = Chemical; -Chemical.prototype.setDirectEvidence = function(directEvidence) { +/** + * + * @param {string} directEvidence + */ +Chemical.prototype.setDirectEvidence = function (directEvidence) { this._directEvidence = directEvidence; }; -Chemical.prototype.getDirectEvidence = function() { +/** + * + * @returns {string} + */ +Chemical.prototype.getDirectEvidence = function () { return this._directEvidence; }; -Chemical.prototype.setDirectEvidenceReferences = function(directEvidenceReferences) { +/** + * + * @param {Annotation[]} directEvidenceReferences + */ +Chemical.prototype.setDirectEvidenceReferences = function (directEvidenceReferences) { this._directEvidenceReferences = []; for (var i = 0; i < directEvidenceReferences.length; i++) { this._directEvidenceReferences.push(new Annotation(directEvidenceReferences[i])); } }; -Chemical.prototype.getDirectEvidenceReferences = function() { - return this._directEvidenceReferences; -}; -Chemical.prototype.setBrandNames = function(brandNames) { - this._brandNames = brandNames; -}; - -Chemical.prototype.getBrandNames = function() { - return this._brandNames; +/** + * + * @returns {Annotation[]} + */ +Chemical.prototype.getDirectEvidenceReferences = function () { + return this._directEvidenceReferences; }; -Chemical.prototype.setReferences = function(references) { +/** + * + * @param {Annotation[]} references + */ +Chemical.prototype.setReferences = function (references) { this._references = []; for (var i = 0; i < references.length; i++) { this._references.push(new Annotation(references[i])); } }; -Chemical.prototype.getReferences = function() { +/** + * + * @returns {Annotation[]} + */ +Chemical.prototype.getReferences = function () { return this._references; }; -Chemical.prototype.setSynonyms = function(synonyms) { +/** + * + * @param {string[]} synonyms + */ +Chemical.prototype.setSynonyms = function (synonyms) { this._synonyms = synonyms; }; -Chemical.prototype.getSynonyms = function() { +/** + * + * @returns {string[]} + */ +Chemical.prototype.getSynonyms = function () { return this._synonyms; }; -Chemical.prototype.setDescription = function(description) { +/** + * + * @param {string} description + */ +Chemical.prototype.setDescription = function (description) { this._description = description; }; -Chemical.prototype.getDescription = function() { +/** + * + * @returns {string} + */ +Chemical.prototype.getDescription = function () { return this._description; }; -Chemical.prototype.setBloodBrainBarrier = function(bloodBrainBarrier) { - this._bloodBrainBarrier = bloodBrainBarrier; -}; - -Chemical.prototype.getBloodBrainBarrier = function() { - return this._bloodBrainBarrier; -}; - module.exports = Chemical; diff --git a/frontend-js/src/main/js/map/data/Comment.js b/frontend-js/src/main/js/map/data/Comment.js index bd3537014f226ff5b8c776a752d95b2600778d78..526ef4294432e5f00a22d020e1e47397c4d7bafd 100644 --- a/frontend-js/src/main/js/map/data/Comment.js +++ b/frontend-js/src/main/js/map/data/Comment.js @@ -3,12 +3,17 @@ var IdentifiedElement = require('./IdentifiedElement'); var Point = require('../canvas/Point'); +/** + * + * @param javaObject + * @constructor + */ function Comment(javaObject) { this.setIdentifiedElement(new IdentifiedElement({ - id : javaObject.elementId, - type : javaObject.type, - modelId : javaObject.modelId, - icon : javaObject.icon + id: javaObject.elementId, + type: javaObject.type, + modelId: javaObject.modelId, + icon: javaObject.icon })); this.setId(javaObject.id); this.setRemoved(javaObject.removed); @@ -24,70 +29,163 @@ function Comment(javaObject) { this.setEmail(javaObject.email); } -Comment.prototype.setIdentifiedElement = function(ie) { +/** + * + * @param {IdentifiedElement} ie + */ +Comment.prototype.setIdentifiedElement = function (ie) { this._ie = ie; }; -Comment.prototype.getIdentifiedElement = function() { +/** + * + * @returns {IdentifiedElement} + */ +Comment.prototype.getIdentifiedElement = function () { return this._ie; }; -Comment.prototype.setPinned = function(pinned) { +/** + * + * @param {boolean} pinned + */ +Comment.prototype.setPinned = function (pinned) { this._pinned = (pinned === true); }; -Comment.prototype.setCoordinates = function(coordinates) { +/** + * + * @param {{x:number, y:number}} coordinates + */ +Comment.prototype.setCoordinates = function (coordinates) { this._coordinates = new Point(coordinates.x, coordinates.y); }; -Comment.prototype.setRemoved = function(removed) { + +/** + * + * @param {boolean} removed + */ +Comment.prototype.setRemoved = function (removed) { this._removed = (removed === true); }; -Comment.prototype.setId = function(id) { +/** + * + * @param {number} id + */ +Comment.prototype.setId = function (id) { this._id = id; }; -Comment.prototype.setContent = function(content) { + +/** + * + * @param {string} content + */ +Comment.prototype.setContent = function (content) { this._content = content; }; -Comment.prototype.isPinned = function() { +/** + * + * @returns {boolean} + */ +Comment.prototype.isPinned = function () { return this._pinned; }; -Comment.prototype.getCoordinates = function() { + +/** + * + * @returns {Point} + */ +Comment.prototype.getCoordinates = function () { return this._coordinates; }; -Comment.prototype.isRemoved = function() { + +/** + * + * @returns {boolean} + */ +Comment.prototype.isRemoved = function () { return this._removed; }; -Comment.prototype.getId = function() { + +/** + * + * @returns {number} + */ +Comment.prototype.getId = function () { return this._id; }; -Comment.prototype.setTitle = function(title) { + +/** + * + * @param {string} title + */ +Comment.prototype.setTitle = function (title) { this._title = title; }; -Comment.prototype.getTitle = function() { + +/** + * + * @returns {string} + */ +Comment.prototype.getTitle = function () { return this._title; }; -Comment.prototype.getContent = function() { + +/** + * + * @returns {string} + */ +Comment.prototype.getContent = function () { return this._content; }; -Comment.prototype.setAuthor = function(author) { +/** + * + * @param {string} author + */ +Comment.prototype.setAuthor = function (author) { this._author = author; }; -Comment.prototype.getAuthor = function() { + +/** + * + * @returns {string} + */ +Comment.prototype.getAuthor = function () { return this._author; }; -Comment.prototype.setEmail = function(email) { + +/** + * + * @param {string} email + */ +Comment.prototype.setEmail = function (email) { this._email = email; }; -Comment.prototype.getEmail = function() { + +/** + * + * @returns {string} + */ +Comment.prototype.getEmail = function () { return this._email; }; -Comment.prototype.setRemoveReason = function(removeReason) { + +/** + * + * @param {string} removeReason + */ +Comment.prototype.setRemoveReason = function (removeReason) { this._removeReason = removeReason; }; -Comment.prototype.getRemoveReason = function() { + +/** + * + * @returns {string} + */ +Comment.prototype.getRemoveReason = function () { return this._removeReason; }; diff --git a/frontend-js/src/main/js/map/data/DataOverlay.js b/frontend-js/src/main/js/map/data/DataOverlay.js index 0a44c3d2dc094ee7bdea1c027a9682068157c7f1..ce255617fead74d44631adeb16c44676b47d022a 100644 --- a/frontend-js/src/main/js/map/data/DataOverlay.js +++ b/frontend-js/src/main/js/map/data/DataOverlay.js @@ -9,6 +9,10 @@ var logger = require('../../logger'); /** * Class representing data in a specific overlay. + * + * @param {number|Object} overlayId + * @param {string} [name] + * @constructor */ function DataOverlay(overlayId, name) { this.setInitialized(false); @@ -44,7 +48,7 @@ function DataOverlay(overlayId, name) { /** * Adds alias to the {@link DataOverlay} * - * @param overlayAlias + * @param {LayoutAlias} overlayAlias * information about alias in the overlay */ DataOverlay.prototype.addAlias = function (overlayAlias) { @@ -55,41 +59,73 @@ DataOverlay.prototype.addAlias = function (overlayAlias) { /** * Adds reaction to the {@link DataOverlay} * - * @param overlayReaction + * @param {LayoutReaction} overlayReaction * information about reaction in the overlay */ DataOverlay.prototype.addReaction = function (overlayReaction) { this.reactions.push(overlayReaction); }; +/** + * + * @returns {number} + */ DataOverlay.prototype.getId = function () { return this.id; }; +/** + * + * @param {number|string} id + */ DataOverlay.prototype.setId = function (id) { this.id = parseInt(id); }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getDescription = function () { return this._description; }; +/** + * + * @param {string} description + */ DataOverlay.prototype.setDescription = function (description) { this._description = description; }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getCreator = function () { return this._creator; }; +/** + * + * @param {string} creator + */ DataOverlay.prototype.setCreator = function (creator) { this._creator = creator; }; +/** + * + * @returns {boolean} + */ DataOverlay.prototype.getInputDataAvailable = function () { return this._inputDataAvailable; }; +/** + * + * @param {string|boolean} inputDataAvailable + */ DataOverlay.prototype.setInputDataAvailable = function (inputDataAvailable) { var value = inputDataAvailable; if (inputDataAvailable === undefined) { @@ -105,10 +141,18 @@ DataOverlay.prototype.setInputDataAvailable = function (inputDataAvailable) { this._inputDataAvailable = value; }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getName = function () { return this.name; }; +/** + * + * @param {string} name + */ DataOverlay.prototype.setName = function (name) { this.name = name; }; @@ -127,23 +171,40 @@ DataOverlay.prototype.getImagesDirectory = function (modelId) { return null; }; +/** + * + * @param {Object.<number,string>} imagesDirectory + */ DataOverlay.prototype.setImagesDirectory = function (imagesDirectory) { this._imagesDirectory = imagesDirectory; }; +/** + * + * @param {LayoutAlias} overlayAlias + */ DataOverlay.prototype.updateAlias = function (overlayAlias) { if (this.aliasById[overlayAlias.getId()] === undefined) { - logger.warn("Cannot update alias, it doesn't exist. Alias: "+ overlayAlias.getId()); + logger.warn("Cannot update alias, it doesn't exist. Alias: " + overlayAlias.getId()); } else { this.aliasById[overlayAlias.getId()].update(overlayAlias); } - }; +/** + * + * @param {number} id + * @returns {LayoutAlias} + */ DataOverlay.prototype.getAliasById = function (id) { return this.aliasById[id]; }; +/** + * + * @param {number} id + * @returns {Promise<LayoutAlias>} + */ DataOverlay.prototype.getFullAliasById = function (id) { var self = this; var alias = self.getAliasById(id); @@ -161,10 +222,18 @@ DataOverlay.prototype.getFullAliasById = function (id) { return Promise.resolve(alias); }; +/** + * + * @param {boolean} value + */ DataOverlay.prototype.setInitialized = function (value) { this._initialized = value; }; +/** + * + * @returns {boolean} + */ DataOverlay.prototype.isInitialized = function () { return this._initialized; }; @@ -185,6 +254,10 @@ DataOverlay.prototype.getReactions = function () { return this.reactions; }; +/** + * + * @returns {Promise} + */ DataOverlay.prototype.init = function () { var self = this; if (this.isInitialized()) { @@ -206,54 +279,106 @@ DataOverlay.prototype.init = function () { }; +/** + * + * @returns {boolean} + */ DataOverlay.prototype.getPublicOverlay = function () { return this._publicOverlay; }; +/** + * + * @param {boolean} publicOverlay + */ DataOverlay.prototype.setPublicOverlay = function (publicOverlay) { this._publicOverlay = publicOverlay; }; +/** + * + * @returns {boolean} + */ DataOverlay.prototype.isDefaultOverlay = function () { return this._defaultOverlay; }; +/** + * + * @param {boolean} defaultOverlay + */ DataOverlay.prototype.setDefaultOverlay = function (defaultOverlay) { this._defaultOverlay = defaultOverlay; }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getContent = function () { return this._content; }; +/** + * + * @param {string} content + */ DataOverlay.prototype.setContent = function (content) { this._content = content; }; +/** + * + * @returns {number} + */ DataOverlay.prototype.getOrder = function () { return this._order; }; +/** + * + * @param {number} order + */ DataOverlay.prototype.setOrder = function (order) { this._order = order; }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getFilename = function () { return this._filename; }; +/** + * + * @param {string} filename + */ DataOverlay.prototype.setFilename = function (filename) { this._filename = filename; }; +/** + * + * @returns {string} + */ DataOverlay.prototype.getType = function () { return this._type; }; +/** + * + * @param {string} type + */ DataOverlay.prototype.setType = function (type) { this._type = type; }; +/** + * + * @param {DataOverlay} overlay + */ DataOverlay.prototype.update = function (overlay) { this.setName(overlay.getName()); this.setDescription(overlay.getDescription()); diff --git a/frontend-js/src/main/js/map/data/Drug.js b/frontend-js/src/main/js/map/data/Drug.js index efbecca6aeee2b131aae5d23ca103d19523764c5..cebafe5a1cac2227db9a1e0f8496d22fa35b751d 100644 --- a/frontend-js/src/main/js/map/data/Drug.js +++ b/frontend-js/src/main/js/map/data/Drug.js @@ -3,6 +3,11 @@ var Annotation = require("./Annotation"); var TargettingStructure = require("./TargettingStructure"); +/** + * + * @param javaObject + * @constructor + */ function Drug(javaObject) { TargettingStructure.call(this, javaObject); if (javaObject !== undefined) { @@ -17,46 +22,86 @@ function Drug(javaObject) { Drug.prototype = Object.create(TargettingStructure.prototype); Drug.prototype.constructor = Drug; -Drug.prototype.setBrandNames = function(brandNames) { +/** + * + * @param {string[]} brandNames + */ +Drug.prototype.setBrandNames = function (brandNames) { this._brandNames = brandNames; }; -Drug.prototype.getBrandNames = function() { +/** + * + * @returns {string[]} + */ +Drug.prototype.getBrandNames = function () { return this._brandNames; }; -Drug.prototype.setReferences = function(references) { +/** + * + * @param {Annotation[]}references + */ +Drug.prototype.setReferences = function (references) { this._references = []; for (var i = 0; i < references.length; i++) { this._references.push(new Annotation(references[i])); } }; -Drug.prototype.getReferences = function() { +/** + * + * @returns {Annotation[]} + */ +Drug.prototype.getReferences = function () { return this._references; }; -Drug.prototype.setSynonyms = function(synonyms) { +/** + * + * @param {string[]} synonyms + */ +Drug.prototype.setSynonyms = function (synonyms) { this._synonyms = synonyms; }; -Drug.prototype.getSynonyms = function() { +/** + * + * @returns {string[]} + */ +Drug.prototype.getSynonyms = function () { return this._synonyms; }; -Drug.prototype.setDescription = function(description) { +/** + * + * @param {string} description + */ +Drug.prototype.setDescription = function (description) { this._description = description; }; -Drug.prototype.getDescription = function() { +/** + * + * @returns {string} + */ +Drug.prototype.getDescription = function () { return this._description; }; -Drug.prototype.setBloodBrainBarrier = function(bloodBrainBarrier) { +/** + * + * @param {boolean} bloodBrainBarrier + */ +Drug.prototype.setBloodBrainBarrier = function (bloodBrainBarrier) { this._bloodBrainBarrier = bloodBrainBarrier; }; -Drug.prototype.getBloodBrainBarrier = function() { +/** + * + * @returns {boolean} + */ +Drug.prototype.getBloodBrainBarrier = function () { return this._bloodBrainBarrier; };