mni.mixin

Classes

mni.mixin.Collector

class mni.mixin.Collector

Bases: mni.mixin.Entity, mni.mixin.Dynamicable

Collector Handles a collection of data by assigning dynamic properties each time a new object type is added to the collection.

Detailed Description:
  • The ‘AssignMethod’ must return the object which will be assigned to the dynamic property.

Property Summary
AssignMethod

Method used to assign multiple sets of data to the same property

CollectionClass

Name of class which can be collected by this object

CollectionDescription

Descriptor of the class which can be collected

Method Summary
addItem(item)

addItem Adds an item to the collection.

Syntax:
  • Adding a single item to the collection:

    >> Bar = mni.bulk.Beam(‘CBAR’, 50) >> addItem(obj, Bar);

  • Adding multiple items to the collection

getItem(tok, bReturnObjectArray)

getItem Retrieves the handle to an item in the collection.

Detailed Description:
  • Multiple items can be retrieved by passing in a cell-str of tokens.

  • Items can be retrieved based on Class, Name, Type or a combination of the three.

  • If none of the tokens match then an empty array is returned.

TODO - Consider whether we want to only select the unique tokens or allow the user to search for duplicates.

removeItem(item)

removeItem TODO

mni.mixin.Dynamicable

class mni.mixin.Dynamicable

Bases: dynamicprops

Dynamicable Describes an object that has dynamic properties.

Syntax:
  • To add a dynamic property in a subclass method:

>> prpName = ‘myDynamicProp’; >> addDynamicProp(obj, prpName)

  • To retrieve a dynamic property:

    >> prpName = ‘myDynamicProp’; >> DynProp = getDynamicProp(obj, prpName);

Detailed Description:
  • When a dynamic property is added the handle of the meta.dynamicproperty object is stored in the hidden property ‘DynamicProps’. This allows the dynamic properties to be interrogated at a future point without first obtaining the object meta information.

See also: dynamicprops

References:

Author : Christopher Szczyglowski Email : chris.szczyglowski@gmail.com Timestamp : 05-Mar-2020 10:43:34

Copyright (c) 2020 Christopher Szczyglowski All Rights Reserved

Revision: 1.0 05-Mar-2020 10:43:34
  • Initial function:

<end_of_pre_formatted_H1>

Method Summary
isequal(objA, objB)

isequal Checks whether the two objects have the same contents.

mni.mixin.Entity

class mni.mixin.Entity

Bases: matlab.mixin.SetGet, matlab.mixin.Heterogeneous

Entity Base-class for all objects in the Matran package.

Detailed Description:
  • All classes are handle class.

  • All classes allow ‘set/get’ syntax via ‘matlab.mixin.SetGet’.

  • All classes are heterogeneous.

See also: handle

matlab.mixin.SetGet matlab.mixin.Heterogeneous

TODO - Set Name and Type to hidden

Property Summary
Name

(Hidden = true) Name of the object - Must be a valid variable name to be compatible with the dynamicprops implementation.

Type

(Hidden = true, Dependent) Type of the object - The last term in the package list

Method Summary
get(varargin)
getEntityType(cls)

getEntityType Returns the object type.

Detailed Description:
  • The object Type is simply the filename of the file which contains the class definition.

  • It can be found by interrogating the class name and removing all prefixes/pacakge lists.

set(varargin)