Home > classes > @timespan > timespan.m

timespan

PURPOSE ^

TIMESPAN timespan object class constructor.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 TIMESPAN timespan object class constructor.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION:  TIMESPAN timespan object class constructor.
               Create a timespan object.

 SUPER CLASSES: ltpda_uoh < ltpda_uo < ltpda_obj

 PROPERTIES:

     Inherit Properties (read only)
       name       - name of object
       created    - creation time (time-object)
       prov       - contains a instance of the provenance class.
       hist       - history of the object (history object)
       version    - cvs-version string.

     Protected Properties (read only)
       startT     - Start time of the time span. (time-object)
       endT       - End time of the time span.   (time-object)
       timeformat - The time format of start- AND end- time.
       timezone   - The timezone of start- AND end- time.
       interval   - Interval between start/end time

 TIMESPAN Methods:

     Defined Abstract methods:
       char          - returns one character string which represents the object
       copy          - copies an object
       display       - displays an object
       string        - converts an object to a command string which will
                       recreate the plist object
       update_struct - updates a object structure to the current tbx-version

     Public methods:

     Protected methods:

     Private methods:
       fromRepository  - construct an timespan from a repository
       fromTimespanDef - construct an timespan from start and end time
       computeInterval - compute the interval of the time span

 CONSTRUCTORS:

       ts = timespan()
       ts = timespan('file_name.mat');
       ts = timespan('file_name.xml');
       ts = timespan( time,       time)
       ts = timespan(time,       '14:00:05')
       ts = timespan('14:00:00',  time)
       ts = timespan('14:00:00', '14:00:05')
       ts = timespan(30000, 50000)
       ts = timespan(20000, 30000, 'HH:MM:SS')
       ts = timespan(plist)

 Parameter sets for plist constructor (in order of priority):

 From XML File
 -------------

   Construct an TIMESPAN by loading it from an XML file.

   'filename' - construct an TIMESPAN from a filename.
                Example: plist('filename', 'ts1.xml')
                [default: empty string]

 From MAT File
 -------------

   Construct an TIMESPAN by loading it from a MAT file.

   'filename' - construct an TIMESPAN from a filename.
                Example: plist('filename', 'ts1.mat')
                [default: empty string]

 From Repository
 ---------------

   Construct an TIMESPAN by retrieving it from an LTPDA repository.

   'Hostname' - the repository hostname. Only those objects which
                are TIMESPANs are returned.
                [default: 'localhost'];

                Additional parameters:

                'Database'   - The database name [default: 'ltpda']
                'ID'         - A vector of object IDs. [default: []]
                'CID'        - Retrieve all timespan objects from a particular
                               collection.

 From Timespan Definition
 ------------------------
   Construct an TIMESPAN by its properties definition
   'startT'- the starting time [default: '1970-01-01 00:30:00.000'];
   'endT'  - the ending time [default: '1980-01-01 12:00:00.010'];
               The times can be as a time-object, a string or a unix time
             Example 1: plist('startT', time, 'endT', '2008-12-31 23:59:59')
             Example 2: plist('startT', '2007-12-31 23:59:59', 'endT', 1206442503406)

                Additional parameters:

             'timezone'   - Timezone (string or java object) [default: 'UTC']
             'timeformat' - Time format (string) [default: 'yyyy-mm-dd HH:MM:SS.FFF']

 From Plist
 ----------

   'Plist'  - construct from a plist. The value passed should be a plist
              object.
              [default: empty plist]

 M-FILE INFO: The following call returns an minfo object that contains
              information about the timespan constructor:
                   >> info = timespan.getInfo
              or   >> info = timespan.getInfo('timespan')

              You can get information about class methods by calling:
                   >> info = timespan.getInfo(method)
              e.g. >> info = timespan.getInfo('eq')

              You can also restrict the sets of parameters contained in
              the minfo object by calling:
                   >> info = timespan.getInfo(method, set)
              e.g. >> info = timespan.getInfo('timespan', 'None')

 VERSION:     $Id: timespan.m,v 1.42 2008/09/07 10:48:46 hewitson Exp $

 HISTORY:     03-04-2007 M Hewitson
                 Creation

 SEE ALSO:    ltpda_uoh, ltpda_uo, ltpda_obj, plist

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % TIMESPAN timespan object class constructor.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION:  TIMESPAN timespan object class constructor.
0005 %               Create a timespan object.
0006 %
0007 % SUPER CLASSES: ltpda_uoh < ltpda_uo < ltpda_obj
0008 %
0009 % PROPERTIES:
0010 %
0011 %     Inherit Properties (read only)
0012 %       name       - name of object
0013 %       created    - creation time (time-object)
0014 %       prov       - contains a instance of the provenance class.
0015 %       hist       - history of the object (history object)
0016 %       version    - cvs-version string.
0017 %
0018 %     Protected Properties (read only)
0019 %       startT     - Start time of the time span. (time-object)
0020 %       endT       - End time of the time span.   (time-object)
0021 %       timeformat - The time format of start- AND end- time.
0022 %       timezone   - The timezone of start- AND end- time.
0023 %       interval   - Interval between start/end time
0024 %
0025 % TIMESPAN Methods:
0026 %
0027 %     Defined Abstract methods:
0028 %       char          - returns one character string which represents the object
0029 %       copy          - copies an object
0030 %       display       - displays an object
0031 %       string        - converts an object to a command string which will
0032 %                       recreate the plist object
0033 %       update_struct - updates a object structure to the current tbx-version
0034 %
0035 %     Public methods:
0036 %
0037 %     Protected methods:
0038 %
0039 %     Private methods:
0040 %       fromRepository  - construct an timespan from a repository
0041 %       fromTimespanDef - construct an timespan from start and end time
0042 %       computeInterval - compute the interval of the time span
0043 %
0044 % CONSTRUCTORS:
0045 %
0046 %       ts = timespan()
0047 %       ts = timespan('file_name.mat');
0048 %       ts = timespan('file_name.xml');
0049 %       ts = timespan( time,       time)
0050 %       ts = timespan(time,       '14:00:05')
0051 %       ts = timespan('14:00:00',  time)
0052 %       ts = timespan('14:00:00', '14:00:05')
0053 %       ts = timespan(30000, 50000)
0054 %       ts = timespan(20000, 30000, 'HH:MM:SS')
0055 %       ts = timespan(plist)
0056 %
0057 % Parameter sets for plist constructor (in order of priority):
0058 %
0059 % From XML File
0060 % -------------
0061 %
0062 %   Construct an TIMESPAN by loading it from an XML file.
0063 %
0064 %   'filename' - construct an TIMESPAN from a filename.
0065 %                Example: plist('filename', 'ts1.xml')
0066 %                [default: empty string]
0067 %
0068 % From MAT File
0069 % -------------
0070 %
0071 %   Construct an TIMESPAN by loading it from a MAT file.
0072 %
0073 %   'filename' - construct an TIMESPAN from a filename.
0074 %                Example: plist('filename', 'ts1.mat')
0075 %                [default: empty string]
0076 %
0077 % From Repository
0078 % ---------------
0079 %
0080 %   Construct an TIMESPAN by retrieving it from an LTPDA repository.
0081 %
0082 %   'Hostname' - the repository hostname. Only those objects which
0083 %                are TIMESPANs are returned.
0084 %                [default: 'localhost'];
0085 %
0086 %                Additional parameters:
0087 %
0088 %                'Database'   - The database name [default: 'ltpda']
0089 %                'ID'         - A vector of object IDs. [default: []]
0090 %                'CID'        - Retrieve all timespan objects from a particular
0091 %                               collection.
0092 %
0093 % From Timespan Definition
0094 % ------------------------
0095 %   Construct an TIMESPAN by its properties definition
0096 %   'startT'- the starting time [default: '1970-01-01 00:30:00.000'];
0097 %   'endT'  - the ending time [default: '1980-01-01 12:00:00.010'];
0098 %               The times can be as a time-object, a string or a unix time
0099 %             Example 1: plist('startT', time, 'endT', '2008-12-31 23:59:59')
0100 %             Example 2: plist('startT', '2007-12-31 23:59:59', 'endT', 1206442503406)
0101 %
0102 %                Additional parameters:
0103 %
0104 %             'timezone'   - Timezone (string or java object) [default: 'UTC']
0105 %             'timeformat' - Time format (string) [default: 'yyyy-mm-dd HH:MM:SS.FFF']
0106 %
0107 % From Plist
0108 % ----------
0109 %
0110 %   'Plist'  - construct from a plist. The value passed should be a plist
0111 %              object.
0112 %              [default: empty plist]
0113 %
0114 % M-FILE INFO: The following call returns an minfo object that contains
0115 %              information about the timespan constructor:
0116 %                   >> info = timespan.getInfo
0117 %              or   >> info = timespan.getInfo('timespan')
0118 %
0119 %              You can get information about class methods by calling:
0120 %                   >> info = timespan.getInfo(method)
0121 %              e.g. >> info = timespan.getInfo('eq')
0122 %
0123 %              You can also restrict the sets of parameters contained in
0124 %              the minfo object by calling:
0125 %                   >> info = timespan.getInfo(method, set)
0126 %              e.g. >> info = timespan.getInfo('timespan', 'None')
0127 %
0128 % VERSION:     $Id: timespan.m,v 1.42 2008/09/07 10:48:46 hewitson Exp $
0129 %
0130 % HISTORY:     03-04-2007 M Hewitson
0131 %                 Creation
0132 %
0133 % SEE ALSO:    ltpda_uoh, ltpda_uo, ltpda_obj, plist
0134 %
0135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0136 
0137 classdef timespan < ltpda_uoh
0138 
0139   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0140   %                            Property definition                            %
0141   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0142 
0143   %---------- Public (read/write) Properties  ----------
0144   properties
0145   end
0146 
0147   %---------- Protected read-only Properties ----------
0148   properties (SetAccess = protected)
0149     startT     = time(0);
0150     endT       = time(0);
0151     timeformat = time(0).timeformat;
0152     timezone   = time(0).timezone;
0153     interval   = '';
0154     version    = '$Id: timespan.m,v 1.42 2008/09/07 10:48:46 hewitson Exp $';
0155   end
0156 
0157   %---------- Private Properties ----------
0158   properties (GetAccess = protected, SetAccess = protected)
0159   end
0160 
0161   %---------- Abstract Properties ----------
0162   properties (Abstract = true, SetAccess = protected)
0163   end
0164 
0165   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0166   %                          Check property setting                           %
0167   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0168 
0169   methods
0170     function obj = set.startT(obj, val)
0171       if ~isa(val, 'time')
0172         error('### The value for the property ''startT'' must be a time-object.\nBut it is from the class [%s]',class(val));
0173       end
0174       obj.startT = val;
0175     end
0176     function obj = set.endT(obj, val)
0177       if ~isa(val, 'time')
0178         error('### The value for the property ''endT'' must be a time-object.\nBut it is from the class [%s]',class(val));
0179       end
0180       obj.endT = val;
0181     end
0182     function obj = set.timeformat(obj, val)
0183       if ~ischar(val)
0184         error('### The value for the property ''timeformat'' must be a character string.');
0185       end
0186       obj.timeformat = val;
0187     end
0188     function obj = set.timezone(obj, val)
0189       if ~strcmp(class(val), 'sun.util.calendar.ZoneInfo')
0190         error('### The value for the property ''timezone'' must be a JAVA sun.util.calendar.ZoneInfo-object.');
0191       end
0192       obj.timezone = val;
0193     end
0194     function obj = set.interval(obj, val)
0195       if ~ischar(val)
0196         error('### The value for the property ''interval'' must be a character string.');
0197       end
0198       obj.interval = val;
0199     end
0200   end
0201 
0202   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0203   %                                Constructor                                %
0204   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0205 
0206   methods
0207     function obj = timespan(varargin)
0208 
0209       import utils.const.*
0210       utils.helper.msg(msg.OMNAME, 'running %s/%s', mfilename('class'), mfilename);
0211 
0212       % Call superclass
0213       obj = obj@ltpda_uoh(varargin{:});
0214 
0215       % Collect all timespan objects
0216       [ts, invars, rest] = utils.helper.collect_objects(varargin(:), 'timespan');
0217 
0218       if isempty(rest) && ~isempty(ts)
0219         % Do copy constructor and return
0220         utils.helper.msg(msg.OPROC1, 'copy constructor');
0221         obj = copy(ts, 1);
0222         for kk=1:numel(obj)
0223           obj(kk).addHistory(timespan.getInfo('timespan', 'None'), [], [], obj(kk).hist);
0224         end
0225         return
0226       end
0227 
0228       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0229 
0230       switch nargin
0231         case 0
0232           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0233           %%%%%%%%%%%%%%%%%%%%%%%%%%%   no input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0234           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0235           utils.helper.msg(msg.OPROC1, 'empty constructor');
0236           obj.addHistory(timespan.getInfo('timespan', 'None'), [], [], []);
0237 
0238         case 1
0239           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0240           %%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%
0241           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0242 
0243           if ischar(varargin{1})
0244 
0245             %%%%%%%%%%   ts = timespan('foo.mat')   %%%%%%%%%%
0246             %%%%%%%%%%   ts = timespan('foo.xml')   %%%%%%%%%%
0247             utils.helper.msg(msg.OPROC1, 'constructing from file %s', varargin{1});
0248             obj = fromFile(obj, varargin{1});
0249 
0250           elseif isa(varargin{1}, 'plist')
0251             %%%%%%%%%%   ts = time(plist)   %%%%%%%%%%
0252 
0253             pl = varargin{1};
0254             filename = find(pl, 'filename');
0255             hostname = find(pl, 'hostname');
0256             conn     = find(pl, 'conn');
0257             ipl      = find(pl, 'plist');
0258             startT   = find(pl, 'startT');
0259             endT     = find(pl, 'endT');
0260 
0261             if isempty(startT)
0262               startT = find(pl, 'start');
0263             end
0264             if isempty(endT)
0265               endT = find(pl, 'end');
0266             end
0267 
0268             if ~isempty(filename)
0269               %-----------------------------------------------------
0270               %--- Construct from file
0271               %-----------------------------------------------------
0272 
0273               utils.helper.msg(msg.OPROC1, 'constructing from file %s', filename);
0274               obj = fromFile(obj, varargin{1});
0275 
0276             elseif ~isempty(hostname) || ~isempty(conn)
0277               %-----------------------------------------------------
0278               %--- Construct from repository
0279               %-----------------------------------------------------
0280               utils.helper.msg(msg.OPROC1, 'constructing from repository %s', hostname);
0281               obj = obj.fromRepository(pl);
0282 
0283             elseif ~isempty(startT) && ~isempty(endT)
0284               %-----------------------------------------------------
0285               %--- Construct from start and end times
0286               %-----------------------------------------------------
0287               utils.helper.msg(msg.OPROC1, 'constructing from start/end times');
0288               obj = obj.fromTimespanDef(pl);
0289 
0290             elseif ~isempty(ipl)
0291               %-----------------------------------------------------
0292               %--- Construct from plist
0293               %-----------------------------------------------------
0294 
0295               if nparams(ipl) == 0
0296                 %%% return empty object
0297               else
0298                 obj = timespan(ipl);
0299               end
0300 
0301             else
0302 
0303               if nparams(pl) == 0
0304                 %%% if the plist is empty then return the default time object
0305               else
0306                 error('### Unknown TIMESPAN constructor method.');
0307               end
0308             end
0309 
0310           elseif isstruct(varargin{1})
0311             %%%%%%%%%%   ts = time(struct)   %%%%%%%%%%
0312 
0313             utils.helper.msg(msg.OPROC1, 'constructing from struct');
0314             %%% Set properties which are declared in this class
0315             ts_struct = varargin{1};
0316 
0317             obj.startT     = utils.helper.struct2obj(ts_struct.startT, 'time');
0318             obj.endT       = utils.helper.struct2obj(ts_struct.endT, 'time');
0319             obj.timeformat = ts_struct.timeformat;
0320             obj.timezone   = ts_struct.timezone;
0321             obj.interval   = ts_struct.interval;
0322             obj.version    = ts_struct.version;
0323 
0324           else
0325             error('### Unknown single argument constructor.');
0326           end
0327 
0328         case 2
0329           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0330           %%%%%%%%%%%%%%%%%%%%%%%%%%%   two input   %%%%%%%%%%%%%%%%%%%%%%%%%%%
0331           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0332 
0333           if (ischar(varargin{1}) || isa(varargin{1}, 'time') || isnumeric(varargin{1})) && ...
0334               (ischar(varargin{2}) || isa(varargin{2}, 'time') || isnumeric(varargin{2}))
0335             %%%%%%%%%%  ts = timespan('14:00:00', '14:00:05')   %%%%%%%%%%
0336             %%%%%%%%%%  ts = timespan('14:00:00', time)         %%%%%%%%%%
0337             %%%%%%%%%%  ts = timespan(time, time)               %%%%%%%%%%
0338             %%%%%%%%%%  ts = timespan(time, '14:00:05')         %%%%%%%%%%
0339 
0340             utils.helper.msg(msg.OPROC1, 'constructing from start/end time');
0341             pli = plist('startT', varargin{1}, 'endT', varargin{2});
0342             obj = obj.fromTimespanDef(pli);
0343 
0344           elseif isa(varargin{1}, 'database') && isnumeric(varargin{2})
0345             %%%%%%%%%%  f = timespan(database, IDs)   %%%%%%%%%%
0346             utils.helper.msg(msg.OPROC1, 'retrieve from repository');
0347             obj = obj.fromRepository(plist('conn', varargin{1}, 'id', varargin{2}));
0348           elseif isa(varargin{1}, 'timespan') && isa(varargin{2}, 'plist') && isempty(varargin{2}.params)
0349             % pass to copy constructor
0350             obj = timespan(varargin{1});
0351           else
0352             error ('  ### Unknown constructor with two inputs.');
0353           end
0354 
0355         case 3
0356           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0357           %%%%%%%%%%%%%%%%%%%%%%%%%%   three input   %%%%%%%%%%%%%%%%%%%%%%%%%%
0358           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0359 
0360           if  (ischar(varargin{1}) || isnumeric(varargin{1})) && ...
0361               (ischar(varargin{2}) || isnumeric(varargin{2})) && ...
0362               ischar(varargin{3})
0363             %%%%%%%%%%  obj = timespan('14:00:00', '14:00:05', 'HH:MM:SS')  %%%%%%%%%%
0364             %%%%%%%%%%  obj = timespan(  200000  ,   300000  , 'HH:MM:SS')  %%%%%%%%%%
0365 
0366             utils.helper.msg(msg.OPROC1, 'constructing from start/end and timeformat');
0367             obj.startT = time(varargin{1}, varargin{3});
0368             obj.endT   = time(varargin{2}, varargin{3});
0369             obj.setTimeformat(obj.startT.timeformat, 'internal');
0370 
0371             % Compute the interval
0372             obj = computeInterval(obj);
0373 
0374             % Add history
0375             ii = timespan.getInfo('timespan', 'From Timespan Definition');
0376             plh = plist(...
0377               'startT', varargin{1}, ...
0378               'endT',   varargin{2}, ...
0379               'timeformat', varargin{3});
0380             obj.addHistory(ii, plh, [], []);
0381 
0382           else
0383             error ('  ### Unknown constructor with three inputs.');
0384           end
0385 
0386         otherwise
0387           [tss, invars, rest] = utils.helper.collect_objects(args, 'timespan');
0388 
0389           %%% Do we have a list of AOs as input
0390           if ~isempty(tss) && isempty(rest)
0391             obj = timespan(tss);
0392           else
0393             error('### Unknown number of arguments.');
0394           end
0395       end
0396 
0397       % Consistency check
0398       if obj.startT.utc_epoch_milli > obj.endT.utc_epoch_milli
0399         error('### The start time is larger than the end time.');
0400       end
0401 
0402     end % End constructor
0403 
0404   end
0405 
0406   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0407   %                             Methods (public)                              %
0408   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0409   methods
0410     varargout = copy(varargin)
0411     varargout = setStartT(varargin)
0412     varargout = setEndT(varargin)
0413     varargout = setTimeformat(varargin)
0414     varargout = setTimezone(varargin)
0415   end
0416 
0417   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0418   %                             Methods (protected)                           %
0419   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0420   methods (Access = protected)
0421   end
0422 
0423   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0424   %                           Methods (private)                               %
0425   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0426   methods (Access = private)
0427     obj = fromTimespanDef(obj, pli)
0428     obj = computeInterval(obj)
0429   end
0430 
0431   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0432   %                            Methods (static)                               %
0433   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0434   methods (Static)
0435 
0436     varargout = update_struct(varargin);
0437 
0438     function out = VEROUT()
0439       out = '$Id: timespan.m,v 1.42 2008/09/07 10:48:46 hewitson Exp $';
0440     end
0441 
0442     function ii = getInfo(varargin)
0443       ii = utils.helper.generic_getInfo(varargin{:}, 'timespan');
0444     end
0445 
0446     function out = SETS()
0447       out = {...
0448         'Default',         ...
0449         'From XML File',   ...
0450         'From MAT File',   ...
0451         'From Repository', ...
0452         'From Timespan Definition', ...
0453         'From Plist'};
0454     end
0455 
0456     function out = getDefaultPlist(set)
0457       switch set
0458         case 'Default'
0459           out = plist();
0460         case 'From Repository'
0461           %--- Repository constructor
0462           out = plist('hostname', 'localhost', 'database', 'ltpda', 'ID', []);
0463         case 'From Timespan Definition'
0464           %--- From definition constructor
0465           out = plist(...
0466             'startT', '1970-01-01 00:30:00.000', ...
0467             'endT',   '1980-01-01 12:00:00.010', ....
0468             'timezone', 'UTC',                  ...
0469             'timeformat', 'yyyy-mm-dd HH:MM:SS.FFF');
0470         case 'From XML File'
0471           %--- Read from XML file
0472           out = plist('filename', '');
0473         case 'From MAT File'
0474           %--- Read from MAT file
0475           out = plist('filename', '');
0476         case 'From Plist'
0477           %--- Create from a plist
0478           out = plist('Plist', []);
0479         otherwise
0480           error('### Unknown set-name [%s] for a default parameter list.', set);
0481       end
0482     end % function out = getDefaultPlist(varargin)
0483 
0484   end % End static methods
0485 
0486   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0487   %                         Methods (static, private)                         %
0488   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0489 
0490   methods (Static, Access=private)
0491     [ao,bo] = abcascade(a1,b1,a2,b2)
0492   end % End static, private methods
0493 
0494 end % End classdef
0495

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003