Bridges-Python-3.0.2  3.0.2
Bridges(PythonAPI)
Public Member Functions | List of all members
bridges.ml_element.MLelement Class Reference
Inheritance diagram for bridges.ml_element.MLelement:
bridges.sl_element.SLelement bridges.element.Element

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
See also
There is a tutorial about Multi Lists : http://bridgesuncc.github.io/tutorials/ML.html

Public Member Functions

def __init__ (self, kwargs)
 Constructor for MLelement. More...
 
def sub_list (self)
 Getter for the sublist at this node if exists. More...
 
def sub_list (self, sl)
 Setter for the start of a new sublist. More...
 
def get_data_structure_type (self)
 Getter for the data structure type. More...
 
def next (self)
 Retrieves the element following this element. More...
 
def next (self, n)
 
def tag (self)
 Getter for the tag of the element. More...
 
def tag (self, t)
 Setter for the tag of the element. More...
 
def get_data_structure_representation (self)
 Getter for the data structure representation. More...
 
def get_list_elements (self, nodes)
 Getter for the elements of the list. More...
 
- Public Member Functions inherited from bridges.sl_element.SLelement
def __init__ (self, kwargs)
 Conctructor for SLelement object. More...
 
def get_data_structure_type (self)
 Getter for the data structure type. More...
 
def next (self)
 Getter for element following this element. More...
 
def next (self, n)
 Setter for the element following this element. More...
 
def value (self)
 Getter for the SLelement value to hold. More...
 
def value (self, val)
 Setter for the value that this SLelement will hold. More...
 
def list_helper (start)
 
def get_data_structure_representation (self)
 Getter for this data structure representation. More...
 
def get_list_elements (self, nodes)
 Get the elements of the list (for internal use only) More...
 
- Public Member Functions inherited from bridges.element.Element
def get_data_structure_type (self)
 Get the data structure representation. More...
 
def __init__ (self, kwargs)
 
def value (self)
 Getter for the value this element is holding. More...
 
def value (self, val)
 Setter for the value of an element. More...
 
def identifier (self)
 Getter for the element identifier. More...
 
def identifier
 Setter for the element identifier. More...
 
def visualizer (self)
 Getter for the element visualizer. More...
 
def visualizer
 Setter function for this element visualizer. More...
 
def get_link_visualizer (self, el)
 
def set_link_visualizer (self, el)
 Setter for the link visualizer of this element. More...
 
def remove_link_visualizer (self, el)
 Deleter function for the lik visualizer of this element. More...
 
def label (self)
 Getter for the element's label. More...
 
def label (self, label)
 Setter for the element's label. More...
 
def size (self)
 Getter for the element's size. More...
 
def size (self, sz)
 Setter for the element's size. More...
 
def color (self)
 Getter for the element's color. More...
 
def color (self, col)
 Setter for the element's size. More...
 
def opacity (self)
 Getter for the element's opacity. More...
 
def opacity (self, op)
 Setter for the element's opacity. More...
 
def shape (self)
 Getter for the element's shape type. More...
 
def shape (self, shp)
 Setter for the element's shape. More...
 
def id (self)
 
def set_location (self, locX, locY)
 Setter for the element's location. More...
 
def get_locationX (self)
 Getter for the element's location in X. More...
 
def get_locationY (self)
 Getter for the element's location in Y. More...
 
def get_element_representation (self)
 Getter for the element's JSON representation (for internal use) More...
 
def get_link_representation (self, lv, src, dest)
 Getter for the JSON representation of the element's link (for internal use) More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ __init__()

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

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

Member Function Documentation

◆ get_data_structure_representation()

def bridges.ml_element.MLelement.get_data_structure_representation (   self,
  dict 
)

Getter for the data structure representation.

Returns
dict representing the json structure before dumping

◆ get_data_structure_type()

def bridges.ml_element.MLelement.get_data_structure_type (   self,
  str 
)

Getter for the data structure type.

Returns
str representing the type

◆ get_list_elements()

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

Getter for the elements of the list.

Parameters
nodesa list of the nodes
Returns
element

◆ next() [1/2]

def bridges.ml_element.MLelement.next (   self)

Retrieves the element following this element.

Returns
MLelement

◆ next() [2/2]

def bridges.ml_element.MLelement.next (   self,
  n 
)

◆ sub_list() [1/2]

def bridges.ml_element.MLelement.sub_list (   self)

Getter for the sublist at this node if exists.

Returns
Element the sublist head element

◆ sub_list() [2/2]

def bridges.ml_element.MLelement.sub_list (   self,
  sl,
  None 
)

Setter for the start of a new sublist.

Parameters
slthe MLelement that is the beginning of a sublist
Returns
None

◆ tag() [1/2]

def bridges.ml_element.MLelement.tag (   self,
  bool 
)

Getter for the tag of the element.

Returns
bool

◆ tag() [2/2]

def bridges.ml_element.MLelement.tag (   self,
  t,
  None 
)

Setter for the tag of the element.

Parameters
tboolean value
Returns
None

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