function display(h)
%DISPLAY Display @tscollection object

%   Author(s): James G. Owen, Rong Chen
%   Copyright 1986-2004 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2004/12/26 21:35:48 $

fprintf(1,'Time Series Collection Object: %s\n\n',h.name);

% Check for empty time
if isempty(h.Time)
    fprintf(1,'      %s\n', 'Empty');
    return
end

fprintf(1,'Time vector characteristics\n');
% Time vector characteristics
if ~isempty(h.timeInfo.Startdate)
    % time is in absolute date/time format
    timeasdate = true;
    formatstr = ['      %s%s%s\n'];
    strStartTime = 'Start date';
    strEndTime = 'End date';
    % determine the display format
    if tsIsDateFormat(h.timeInfo.Format)
        % display format has been specified and the format is supported by tstool
        fprintf(1,formatstr, strStartTime, blanks(22-length(strStartTime)), ...
            datestr(tsunitconv('days',h.timeInfo.Units)*h.timeInfo.Start+...
            datenum(h.timeInfo.Startdate),h.timeInfo.Format));
        fprintf(1,formatstr, strEndTime, blanks(22-length(strEndTime)), ...
            datestr(tsunitconv('days',h.timeInfo.Units)*h.timeInfo.End+...
            datenum(h.timeInfo.Startdate),h.timeInfo.Format));   
    else
        % use default display format 0: 'dd-mmm-yyyy HH:MM:SS'
        fprintf(1,formatstr, strStartTime, blanks(22-length(strStartTime)), ...
            datestr(tsunitconv('days',h.timeInfo.Units)*h.timeInfo.Start+...
            datenum(h.timeInfo.Startdate),'dd-mmm-yyyy HH:MM:SS'));
        fprintf(1,formatstr, strEndTime, blanks(22-length(strEndTime)), ...
            datestr(tsunitconv('days',h.timeInfo.Units)*h.timeInfo.End+...
            datenum(h.timeInfo.Startdate),'dd-mmm-yyyy HH:MM:SS'));   
    end           
else
    timeasdate = false;
    if ~isempty(h.timeInfo.Startdate)
        startdatestr = 'Reference start date';
        fprintf(1,'      %s%s%s\n', startdatestr, ...
            blanks(22-length(startdatestr)),h.timeInfo.Startdate);
    end
    strStartTime = 'Start time';
    strEndTime = 'End time';
    formatstr = ['      %s%s%d ' h.timeInfo.units '\n'];
    fprintf(1,formatstr, strStartTime, blanks(22-length(strStartTime)), h.timeInfo.start);
    fprintf(1,formatstr, strEndTime, blanks(22-length(strEndTime)), h.timeInfo.end);
end    

memberVars=h.getMembers;
fprintf(1,'\nMember Time Series Objects:\n');
for k=1:length(memberVars)
    fprintf(1,'      %s\n', memberVars{k});
end