%ReduceTaskResultCombiner
% A data class that combines the results of a partitioned task.

%   Copyright 2014-2016 The MathWorks, Inc.

classdef (Sealed, Hidden) ReduceTaskResultCombiner < handle
    
    properties (Access = private)
        TaskResult = [];
    end
    
    methods
        function append(obj, result)
            if isempty(obj.TaskResult)
                obj.TaskResult = result;
            else
                obj.TaskResult = [obj.TaskResult; result];
            end
        end
        
        function outputFiles = getOutputFiles(obj)
            if isempty(obj.TaskResult)
                outputFiles = {};
            else
                outputFiles = obj.TaskResult.OutputFiles;
            end
        end
    end
end