view war/scripts/sti/DataSet.js @ 41:90b7bbc9962f default

Merged the bugfixes
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Thu, 06 Dec 2012 18:09:00 +0100
parents cf06b77a8bbd
children 8b58d9bc0bb6
line wrap: on
line source

/**
 * 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 );
    }
    
}