classdef SimpleExtractionStrategy < fxptds.RangeAggregation.RangeExtractionStrategy
    %% SIMPLEEXTRACTIONSTRATEGY class
    % This class implements a simple extraction strategy for a specific
    % type of range from a group. In this implementation the ranges are
    % simply pulled out of the data type group into a vector. 
    
    % Copyright 2018 The MathWorks, Inc.
    
    methods
        function this = SimpleExtractionStrategy(type)
            % register the range type
            this@fxptds.RangeAggregation.RangeExtractionStrategy(type);
        end
        
        function range = extractRange(this, group)
            % get the range object from the group
            rangeObject = group.ranges{fxptds.RangeType.getIndex(this.type)};
            
            % get the extrema of the range object
            range = rangeObject.getExtrema;
        end
    end
end

