Skip to content

Commit d5e814b

Browse files
committed
[Matlab] Add basic NamedEntity documentation
1 parent b641982 commit d5e814b

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

+nix/NamedEntity.m

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
% MixIn class for NIX entites with basic dynamic properties.
2+
%
3+
% In addition to the properties defined by nix.Entity most entities of the NIX data model
4+
% further provide the properties id, name, type and definition.
5+
%
6+
% The id property of an entity is automatically assigned and serves as a machine readable
7+
% unique identifier. The name property of an entity serves as a human readable identifier
8+
% and can be set at the creation of an entity. The type property is used to allow the
9+
% specification of additional semantic meaning for an entity and therefore can introduce
10+
% domain-specificity into the generic data model. The optional definition property allows
11+
% the user to add a freely assignable textual definition to the entity.
12+
%
13+
% Dynamic properties:
14+
% id (char): read-only, automatically created id of the entity.
15+
% name (char): read-only, name of the entity.
16+
% type (char): read-write, type can be used to give semantic meaning to an
17+
% entity and expose it to search methods in a broader context.
18+
% definition (char): read-write, additional description of the entity.
19+
%
20+
% See also: nix.Block, nix.Group, nix.DataArray, nix.Source, nix.Tag,
21+
% nix.MultiTag, nix.Section.
22+
%
23+
%
124
% Copyright (c) 2016, German Neuroinformatics Node (G-Node)
225
%
326
% All rights reserved.
@@ -7,8 +30,6 @@
730
% LICENSE file in the root of the Project.
831

932
classdef NamedEntity < nix.Entity
10-
% NamedEntity
11-
% base class for nix entities with name/type/definition
1233

1334
methods
1435
function obj = NamedEntity(h)
@@ -22,8 +43,16 @@
2243
end
2344

2445
function r = compare(obj, entity)
25-
% Compares first name and second id, return > 0 if the entity
26-
% is larger than the other, 0 if both are equal, and < 0 otherwise.
46+
% Checks two NIX entities of the same class for equality.
47+
%
48+
% The name property is the first comparison. If they are the same,
49+
% the ids of the entities will be compared.
50+
%
51+
% Returns: (double) 0 if both entities are equal.
52+
% > or < 0 if the entities are different.
53+
%
54+
% Example: check = currSource.compare(otherSource);
55+
2756
if (~isa(obj, class(entity)))
2857
err.identifier = 'NIXMX:InvalidArgument';
2958
err.message = 'Only entities of the same class can be compared.';

0 commit comments

Comments
 (0)