%AbstractKeyValuesSource
% Interface class for any source of values with attached key metadata.
% Implementors of this class must guarantee to return the data sorted ascending
% by key.

%   Copyright 2014-2016 The MathWorks, Inc.

classdef (Abstract, Hidden) AbstractKeyValuesSource < handle
    methods (Abstract)
        % Returns true if and only if there is more data overall to read.
        result = hasData(this);
        
        % Returns true if and only if there is more data associated with the
        % current key.
        result = hasDataForCurrentKey(this);
        
        % Indicate that this source should start reading values from the
        % next key. This cannot be called when there is still data for the
        % current key.
        key = nextKey(this);
        
        % Discard any remaining data associated with the current key.
        discardRemainingDataForCurrentKey(this);
        
        % Return a chunk of values up to maxNumEntries number of entries
        % associated with the current key.
        values = read(this, maxNumEntries);
    end
end
