Bridges-Python 3.5.1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
bridges.ml_element.MLelement Class Reference

This class can be used to instantiate Multi-list Elements. More...

Inheritance diagram for bridges.ml_element.MLelement:
bridges.sl_element.SLelement bridges.element.Element

Public Member Functions

None __init__ (self, **kwargs)
 Constructor for MLelement.
 
str get_data_structure_type (self)
 Getter for the data structure type.
 
dict get_data_structure_representation (self)
 Getter for the data structure representation.
 
 get_list_elements (self, nodes)
 Getter for the elements of the list.
 
- Public Member Functions inherited from bridges.sl_element.SLelement
 list_helper (start)
 helper method for graph adjacency list
 
 iterator (self)
 used for range loops
 
- Public Member Functions inherited from bridges.element.Element
LinkVisualizer get_link_visualizer (self, el)
 Getter for the link visualizer object that links this element to another element specified by the argument.
 
None set_link_visualizer (self, el)
 Setter for the link visualizer of this element.
 
None remove_link_visualizer (self, el)
 Deleter function for the lik visualizer of this element.
 
 set_location (self, locX, locY)
 Setter for the element's location.
 
 get_locationX (self)
 Getter for the element's location in X.
 
 get_locationY (self)
 Getter for the element's location in Y.
 
 get_element_representation (self)
 Getter for the element's JSON representation (for internal use)
 
 get_link_representation (self, lv, src, dest)
 Getter for the JSON representation of the element's link (for internal use)
 

Protected Member Functions

None _default_sub_list_nodes (self)
 function for setting sublist defaults
 
 _get_list_elements_R (self, list, nodes)
 

Protected Attributes

 _sublist
 
 _tag
 
 _sub_list
 
- Protected Attributes inherited from bridges.sl_element.SLelement
 _next
 
- Protected Attributes inherited from bridges.element.Element
 _link_visualizer
 
 _ids
 
 _identifier
 
 _visualizer
 
 _value
 
 _label
 

Properties

 sub_list = property
 Getter for the sublist at this node if exists.
 
 next = property
 Retrieves the element following this element.
 
 tag = property
 Getter for the tag of the element.
 
- Properties inherited from bridges.sl_element.SLelement
 value = property
 Getter for the SLelement value to hold.
 
- Properties inherited from bridges.element.Element
 identifier = property
 Getter for the element identifier.
 
 visualizer = property
 Getter for the element visualizer.
 
 label = property
 Getter for the element's label.
 
 size = property
 Getter for the element's size.
 
 color = property
 Getter for the element's color.
 
 opacity = property
 Getter for the element's opacity.
 
 shape = property
 Getter for the element's shape type.
 
 id = property
 Get numer of ids of element object.
 

Additional Inherited Members

- Static Public Attributes inherited from bridges.element.Element
int ids = 0
 

Detailed Description

This class can be used to instantiate Multi-list Elements.

This class extends SLelement (singly linked list element) to build multi-lists; Multilist elements contain a tag (boolean) that indicates if the element contains a sublist or not; if the tag is true, then there is a sublist beginning at this node and the starting point is the ‘sublist’ field in the element. If the tag is false, then the list continues as a normal singly linked list. The sublists are re recursive: any sublist can have its own sublists and so on. As in singly linked elements, the next pointer points to the following list element and each element contains a generic application specific object.

Multi-list elements contain a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.

Elements also have a LinkVisualizer object, that is used when they are linked to another element, appropriate for setting link attributes, for instance, between the current element and its next element. In this case, the link in question is that which connects the element to the following elements; a similar logic follows for sublists.

Author
Kalpathi Subramanian, Matthew McQuaigue
Date
2018, 7/23/19, 2021
See also
There is a tutorial about Multi Lists : https://bridgesuncc.github.io/tutorials/MultiList.html

Constructor & Destructor Documentation

◆ __init__()

None bridges.ml_element.MLelement.__init__ (   self,
**  kwargs 
)

Constructor for MLelement.

       (str) label: the label the SLelement will hold and show on bridges visualization
       (object) e: the generic object/value that this SLelement will hold
       (object) next: the next element that will be assigned to this SLelement next pointer
Parameters
sublistthe MLelement that is the beginning of a sublist
Returns
None

Reimplemented from bridges.sl_element.SLelement.

Member Function Documentation

◆ _default_sub_list_nodes()

None bridges.ml_element.MLelement._default_sub_list_nodes (   self)
protected

function for setting sublist defaults

Returns
None

◆ _get_list_elements_R()

bridges.ml_element.MLelement._get_list_elements_R (   self,
  list,
  nodes 
)
protected

◆ get_data_structure_representation()

dict bridges.ml_element.MLelement.get_data_structure_representation (   self)

Getter for the data structure representation.

Returns
dict representing the json structure before dumping

Reimplemented from bridges.sl_element.SLelement.

◆ get_data_structure_type()

str bridges.ml_element.MLelement.get_data_structure_type (   self)

Getter for the data structure type.

Returns
str representing the type

Reimplemented from bridges.sl_element.SLelement.

◆ get_list_elements()

bridges.ml_element.MLelement.get_list_elements (   self,
  nodes 
)

Getter for the elements of the list.

Parameters
nodesa list of the nodes
Returns
element

Reimplemented from bridges.sl_element.SLelement.

Member Data Documentation

◆ _sub_list

bridges.ml_element.MLelement._sub_list
protected

◆ _sublist

bridges.ml_element.MLelement._sublist
protected

◆ _tag

bridges.ml_element.MLelement._tag
protected

Property Documentation

◆ next

bridges.ml_element.MLelement.next = property
static

Retrieves the element following this element.

Returns
MLelement

◆ sub_list

bridges.ml_element.MLelement.sub_list = property
static

Getter for the sublist at this node if exists.

Returns
Element the sublist head element

◆ tag

bridges.ml_element.MLelement.tag = property
static

Getter for the tag of the element.

Returns
bool

The documentation for this class was generated from the following file: