server/src/main/resources/eclairjs/Accumulable.js
function () {
        var jvmObject;
        if (arguments.length == 1) {
            jvmObject = arguments[0];
        } else {
            var value = arguments[0];
            this._accumulableParam = arguments[1];
            if (arguments[1] instanceof FloatAccumulatorParam) {
                value = parseFloat(value);
            } else if (arguments[1] instanceof IntAccumulatorParam) {
                value = new java.lang.Integer(parseInt(value)); // we need to create a Integer or we will get a java.lang.Double
            }
            var accumulableParam_uw = Utils.unwrapObject(arguments[1]);
            jvmObject = new org.apache.spark.Accumulable(value, accumulableParam_uw);
        }

        JavaWrapper.call(this, jvmObject);

    }
function () {
        var jvmObject;
        if (arguments.length == 1) {
            jvmObject = arguments[0];
        } else {
            var value = arguments[0];
            this._accumulableParam = arguments[1];
            if (arguments[1] instanceof FloatAccumulatorParam) {
                value = parseFloat(value);
            } else if (arguments[1] instanceof IntAccumulatorParam) {
                value = new java.lang.Integer(parseInt(value)); // we need to create a Integer or we will get a java.lang.Double
            }
            var accumulableParam_uw = Utils.unwrapObject(arguments[1]);
            jvmObject = new org.apache.spark.Accumulable(value, accumulableParam_uw);
        }

        JavaWrapper.call(this, jvmObject);

    }
function ( ) { var jvmObject ; if ( arguments . length == 1 ) { jvmObject = arguments [ 0 ] ; } else { var value = arguments [ 0 ] ; this . _accumulableParam = arguments [ 1 ] ; if ( arguments [ 1 ] instanceof FloatAccumulatorParam ) { value = parseFloat ( value ) ; } else if ( arguments [ 1 ] instanceof IntAccumulatorParam ) { value = new java . lang . Integer ( parseInt ( value ) ) ; // we need to create a Integer or we will get a java.lang.Double } var accumulableParam_uw = Utils . unwrapObject ( arguments [ 1 ] ) ; jvmObject = new org . apache . spark . Accumulable ( value , accumulableParam_uw ) ; } JavaWrapper . call ( this , jvmObject ) ; }
A data type that can be accumulated, ie has an commutative and associative "add" operation,
but where the result type, `R`, may be different from the element type being added, `T`.

You must define how to add data, and how to merge two of these together.  For some data types,
such as a counter, these might be the same operation. In that case, you can use the simpler
{@link Accumulator}. They won't always be the same, though -- e.g., imagine you are
accumulating a set. You will add items to the set, and you will union two sets together.

@classdesc
@constructor
@memberof module:eclairjs
@param {object} initialValue initial value of accumulator
@param {module:eclairjs.AccumulableParam} param helper object defining how to add elements
 /*
NOTE for now EclairJS will only support floats and int types
A data type that can be accumulated ie has an commutative and associative add operation but where the result type R may be different from the element type being added T .