function self = undo(self)
% UNDO move back queue index and prepare return value for the next get
% method
%   queue = undo(queue)
%
% $Id$

% reach empty queue
% -----------------
switch self.index
  case 0

    return
    
  case 1
    
    % move index back
    % ---------------
    self.index = self.index - 1;
    
    % reset self.data
    % ---------------
    self.data = {};

    % return, don't make any change
    % -----------------------------
    return
    
  otherwise
    % move index back
    % ---------------
    self.index = self.index - 1;

    % prepare (copy) data for get method
    % ----------------------------------
    self.data = self.buffer{self.index};
end





