Home > classes > @time > get.m

get

PURPOSE ^

GET get time properties.

SYNOPSIS ^

function val = get(tt, prop_name)

DESCRIPTION ^

 GET get time properties.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: GET get time properties.

 CALL:        value = get(tt, 'property');

 EXAMPLES:    utc_epoch_milli  = get(tt, 'utc_epoch_milli');
              timezone         = get(tt, 'timezone');
              timezone_IDs     = get(tt, 'timezone_IDs');
              timezone_IDs     = get(tt, 'IDs');
              timeformat       = get(tt, 'timeformat');
              time_str         = get(tt, 'time_str');

 VERSION:     $Id: get.m,v 1.7 2007/08/20 16:04:58 ingo Exp $

 HISTORY:     23-07-2007 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function val = get(tt, prop_name)
0002 % GET get time properties.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: GET get time properties.
0007 %
0008 % CALL:        value = get(tt, 'property');
0009 %
0010 % EXAMPLES:    utc_epoch_milli  = get(tt, 'utc_epoch_milli');
0011 %              timezone         = get(tt, 'timezone');
0012 %              timezone_IDs     = get(tt, 'timezone_IDs');
0013 %              timezone_IDs     = get(tt, 'IDs');
0014 %              timeformat       = get(tt, 'timeformat');
0015 %              time_str         = get(tt, 'time_str');
0016 %
0017 % VERSION:     $Id: get.m,v 1.7 2007/08/20 16:04:58 ingo Exp $
0018 %
0019 % HISTORY:     23-07-2007 Diepholz
0020 %                 Creation
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 
0024 fields = fieldnames(tt);
0025 
0026 fields{end+1} = 'timezone_IDs';
0027 
0028 if strcmpi(prop_name, 'timezone_IDs') || strcmpi(prop_name, 'IDs')
0029   val = java.util.TimeZone.getAvailableIDs;
0030   return
0031 end
0032 
0033 if ~ismember(prop_name, fields)
0034   error(['### ''' prop_name, ''' is not a valid time property.']);
0035 else
0036   val = tt.(prop_name);
0037 end
0038 
0039

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003