classdef ParameterID < modelpack.VariableID
    %modelpack.ParameterID class
    %   modelpack.ParameterID extends modelpack.VariableID.
    %

    %    modelpack.ParameterID properties:
    %       Description - Property is of type 'ustring'
    %
    %    modelpack.ParameterID methods:
    %       getClass - Returns the class of the value of the parameter identified by THIS.
    %       getLocations - Returns the full names of the objects that use the parameter
    %       isSame - Default implementation for determining whether a given ParameterID
    %       setClass - Sets the class of the value of the parameter identified by THIS.
    %       setLocations - Sets the full names of the objects that use the parameter

    % Copyright 2000-2023 The MathWorks, Inc.

    methods  % public methods
        function cls = getClass(this)
            % GETCLASS Returns the class of the value of the parameter identified by THIS.
            %
            % CLS is a string (cell array of strings if THIS is an object array).

            n = numel(this);

            if n == 1
                cls = '';
            else
                cls = cell(n,1);
                cls(:) = {''};
            end

            warning(message('Controllib:general:AbstractMethodMustBeOverloaded'));

        end  % getClass

        function names = getLocations(this)
            % GETLOCATIONS Returns the full names of the objects that use the parameter
            % identified by THIS.
            %
            % NAMES is a cell array of strings (cell array of cell arrays if THIS is an
            % object array).
            %
            % ATTN: Model name is not part of the location names.

            n = numel(this);

            if n == 1
                names = {};
            else
                names = cell(n,1);
                names(:) = {{}};
            end


            warning(message('Controllib:general:AbstractMethodMustBeOverloaded'));

        end  % getLocations

        function flag = isSame(this, ID)
            % ISSAME Default implementation for determining whether a given ParameterID
            % object identifies the same object as THIS.  Equivalent to operator
            % overloading for "==".

            flag = false;

            if (length(this(:)) == length(ID(:))) && ...
                    isa(ID, class(this)) && ...
                    all( strcmp(ID.getFullName, this.getFullName) ) && ...
                    isequal(ID.getDimensions, this.getDimensions) && ...
                    all( strcmp(ID.getClass, this.getClass) )
                flag = true;
            end

        end  % isSame

        function setClass(~, ~)
            % SETCLASS Sets the class of the value of the parameter identified by THIS.
            %
            % CLS is a string.

            warning(message('Controllib:general:AbstractMethodMustBeOverloaded'));

        end  % setClass

        function setLocations(~, ~)
            % SETLOCATIONS Sets the full names of the objects that use the parameter
            % identified by THIS.
            %
            % NAMES is a cell array of strings.
            %
            % ATTN: Model name is not part of the location names.

            warning(message('Controllib:general:AbstractMethodMustBeOverloaded'));

        end  % setLocations

    end  % public methods

end  % classdef

% LocalWords:  GETCLASS CLS GETLOCATIONS SETCLASS SETLOCATIONS
