_updateFreq(field, index) {
        var map = this.fields[index].freqMap;
        var tmp = this.fields[index].freqTmp;
        var tmpMinVal = this.fields[index].tmpMinVal;
        var val = map.get(field.value);
        //check if the value is already in the list, if yes, update count, if not, add
        if(typeof val !== 'undefined') {
            map.set(field.value, val+1);
            val = val+1;
        } else {
            map.set(field.value, 1);
            val = 1;
        }
        //the tmp list (top n values)
        if(this.computeTmp) {
            var tmpVl = tmp.get(field.value);
            //check if the value exists in the list
            if(typeof tmpVl !== 'undefined') {
                //add one to the value from the list
                tmp.set(field.value, val);
                //if the value was minimum in the list, check if it is more than any other value after update
                if(field.value == tmpMinVal.key) {
                    var min = tmpMinVal.value;
                    var minKey = field.value;
                    //check if any value from the list has lower frequency
                    for( let key of tmp.keys()) {
                        if(tmp.get(key) < min) {
                            min = tmp.get(key);
                            minKey = key;
                        }
                    }
                    //if lower frequency found, set is as minimum for this field
                    tmpMinVal = {key: minKey, value: min};
                }
            } else {
                //value was not found in the list
                //add new value to the list if size of tempList is under max acceptable
                //set this value as minimum automatically
                if(tmp.size < this.maxTmp) {
                    tmp.set(field.value, val);
                    if(tmp.size == 1) {
                        tmpMinVal = {key: field.value, value: val};
                    }
                //if value is not in the list and list is "full"
                } else {
                    //check if frequency is higher than the minimum in the list. If yes, delete minimum and add the new value as the minimum
                    if(val >= tmpMinVal.value) {
                        if(tmpMinVal.key != null) {
                            tmp.delete(tmpMinVal.key);
                        }
                        tmp.set(field.value, val);
                        tmpMinVal = {key: field.value, value: val};
                    }
                }
            }
        }
        //check unique/distinct/nonunique counts
        if(val == 1) {
            //this.distinctCount = {nonUnique: 0, unique: 0,duplicate: 0, distinct: 0};
            this.distinctCount[index].distinct++;
            this.distinctCount[index].unique++;
        } else {
            if(val == 2) {
                this.distinctCount[index].nonUnique++;
                this.distinctCount[index].unique--;
            }
            this.distinctCount[index].duplicate++;

        }
        //update metrics of the object
        this.fields[index].freqMap=map;
        this.fields[index].freqTmp=tmp;
        this.fields[index].tmpMinVal=tmpMinVal;
    }
/**
     * update single value for single field .. compute frequency
     * @param field
     * @param index
     * @private
     */
update single value for single field .. compute frequency
@param field
@param index
@private
update single value for single field .. compute frequency @param field @param index @private
_updateFreq(field, index) {
        var map = this.fields[index].freqMap;
        var tmp = this.fields[index].freqTmp;
        var tmpMinVal = this.fields[index].tmpMinVal;
        var val = map.get(field.value);
        if(typeof val !== 'undefined') {
            map.set(field.value, val+1);
            val = val+1;
        } else {
            map.set(field.value, 1);
            val = 1;
        }
        if(this.computeTmp) {
            var tmpVl = tmp.get(field.value);
            if(typeof tmpVl !== 'undefined') {
                tmp.set(field.value, val);
                if(field.value == tmpMinVal.key) {
                    var min = tmpMinVal.value;
                    var minKey = field.value;
                    for( let key of tmp.keys()) {
                        if(tmp.get(key) < min) {
                            min = tmp.get(key);
                            minKey = key;
                        }
                    }
                    tmpMinVal = {key: minKey, value: min};
                }
            } else {
                if(tmp.size < this.maxTmp) {
                    tmp.set(field.value, val);
                    if(tmp.size == 1) {
                        tmpMinVal = {key: field.value, value: val};
                    }
                } else {
                    if(val >= tmpMinVal.value) {
                        if(tmpMinVal.key != null) {
                            tmp.delete(tmpMinVal.key);
                        }
                        tmp.set(field.value, val);
                        tmpMinVal = {key: field.value, value: val};
                    }
                }
            }
        }
        if(val == 1) {
            this.distinctCount[index].distinct++;
            this.distinctCount[index].unique++;
        } else {
            if(val == 2) {
                this.distinctCount[index].nonUnique++;
                this.distinctCount[index].unique--;
            }
            this.distinctCount[index].duplicate++;
        }
        this.fields[index].freqMap=map;
        this.fields[index].freqTmp=tmp;
        this.fields[index].tmpMinVal=tmpMinVal;
    }
_updateFreq ( field , index ) { var map = this . fields [ index ] . freqMap ; var tmp = this . fields [ index ] . freqTmp ; var tmpMinVal = this . fields [ index ] . tmpMinVal ; var val = map . get ( field . value ) ; if ( typeof val !== 'undefined' ) { map . set ( field . value , val + 1 ) ; val = val + 1 ; } else { map . set ( field . value , 1 ) ; val = 1 ; } if ( this . computeTmp ) { var tmpVl = tmp . get ( field . value ) ; if ( typeof tmpVl !== 'undefined' ) { tmp . set ( field . value , val ) ; if ( field . value == tmpMinVal . key ) { var min = tmpMinVal . value ; var minKey = field . value ; for ( let key of tmp . keys ( ) ) { if ( tmp . get ( key ) < min ) { min = tmp . get ( key ) ; minKey = key ; } } tmpMinVal = { key : minKey , value : min } ; } } else { if ( tmp . size < this . maxTmp ) { tmp . set ( field . value , val ) ; if ( tmp . size == 1 ) { tmpMinVal = { key : field . value , value : val } ; } } else { if ( val >= tmpMinVal . value ) { if ( tmpMinVal . key != null ) { tmp . delete ( tmpMinVal . key ) ; } tmp . set ( field . value , val ) ; tmpMinVal = { key : field . value , value : val } ; } } } } if ( val == 1 ) { this . distinctCount [ index ] . distinct ++ ; this . distinctCount [ index ] . unique ++ ; } else { if ( val == 2 ) { this . distinctCount [ index ] . nonUnique ++ ; this . distinctCount [ index ] . unique -- ; } this . distinctCount [ index ] . duplicate ++ ; } this . fields [ index ] . freqMap = map ; this . fields [ index ] . freqTmp = tmp ; this . fields [ index ] . tmpMinVal = tmpMinVal ; }
update single value for single field .. compute frequency
 @param field
 @param index
 @private
update single value for single field .. compute frequency @param field @param index @private
//check if the value is already in the list, if yes, update count, if not, add //the tmp list (top n values) //check if the value exists in the list //add one to the value from the list //if the value was minimum in the list, check if it is more than any other value after update //check if any value from the list has lower frequency //if lower frequency found, set is as minimum for this field //value was not found in the list //add new value to the list if size of tempList is under max acceptable //set this value as minimum automatically //if value is not in the list and list is "full" //check if frequency is higher than the minimum in the list. If yes, delete minimum and add the new value as the minimum //check unique/distinct/nonunique counts //this.distinctCount = {nonUnique: 0, unique: 0,duplicate: 0, distinct: 0}; //update metrics of the object