Mercurial > hg > STI-GWT
diff war/scripts/sti/DataSet.js @ 3:cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
git-svn-id: http://dev.dariah.eu/svn/repos/eu.dariah.de/ap1/sti-gwt-dariah-geobrowser@36 f2b5be40-def6-11e0-8a09-b3c1cc336c6b
author | StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b> |
---|---|
date | Tue, 17 Jul 2012 13:34:40 +0000 |
parents | |
children | 8b58d9bc0bb6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/war/scripts/sti/DataSet.js Tue Jul 17 13:34:40 2012 +0000 @@ -0,0 +1,38 @@ +/** + * class that represents all needed informations about a performed dataset + * @param {DataObject[]} objects corresponding data objects of this data set + * @param {String} termIdentifier is a textual identifier for this dataset + * @param {int} maxGranularity is the maximum granularity of the dataobjects of the set + * + * @constructor + */ +function DataSet(objects, termIdentifier, maxGranularity){ + + this.objects = objects; + this.termIdentifier = termIdentifier; + this.maxGranularity = maxGranularity; + +} + +DataSet.prototype = { + + /** + * adds an object to the data set + * @param {DataObject} object the object to add + */ + addObject: function(object){ + this.objects.push(object); + if( this.maxGranularity < object.granularity ){ + this.maxGranularity = object.granularity; + } + }, + + /** + * copies this dataset without objects + * @return a DataSet object copy + */ + copy: function(){ + return new DataSet( [], this.termIdentifier, 0 ); + } + +}