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

This class can be used to instantiate Singly Linked Elements. More...

Inheritance diagram for bridges.sl_element.SLelement:
bridges.element.Element bridges.circ_sl_element.CircSLelement bridges.dl_element.DLelement bridges.ml_element.MLelement bridges.circ_dl_element.CircDLelement

Public Member Functions

None __init__ (self, **kwargs)
 Conctructor for SLelement object.
 
str get_data_structure_type (self)
 Getter for the data structure type.
 
 list_helper (start)
 helper method for graph adjacency list
 
dict get_data_structure_representation (self)
 Getter for this data structure representation.
 
 get_list_elements (self, nodes)
 Get the elements of the list (for internal use only)
 
 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 Attributes

 _next
 
- Protected Attributes inherited from bridges.element.Element
 _link_visualizer
 
 _ids
 
 _identifier
 
 _visualizer
 
 _value
 
 _label
 

Properties

 next = property
 Getter for element following this element.
 
 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 Singly Linked Elements.

This class extends Element and takes a generic parameter <E> representing application specific data. This element forms the basic building block for singly linked lists. Singly linked elements have a field pointing to the next element along the 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.

Author
Matthew Mcquaigue
Date
2018, 6/24/19, 2021
See also
Singly Linked List tutorial : https://bridgesuncc.github.io/tutorials/SinglyLinkedList.html

Constructor & Destructor Documentation

◆ __init__()

None bridges.sl_element.SLelement.__init__ (   self,
**  kwargs 
)

Conctructor for SLelement object.

       (Generic) e: the generic object that this SLelement will hold
       (str) label: the label of the SLelement that shows up on the bridges visualization
       (Element) next: the element that should be assigned to the next pointer
Returns
None

Reimplemented from bridges.element.Element.

Reimplemented in bridges.circ_dl_element.CircDLelement, bridges.circ_sl_element.CircSLelement, bridges.ml_element.MLelement, and bridges.dl_element.DLelement.

Member Function Documentation

◆ get_data_structure_representation()

dict bridges.sl_element.SLelement.get_data_structure_representation (   self)

Getter for this data structure representation.

Returns
dict representing the JSON before dumping

Reimplemented in bridges.dl_element.DLelement, and bridges.ml_element.MLelement.

◆ get_data_structure_type()

str bridges.sl_element.SLelement.get_data_structure_type (   self)

Getter for the data structure type.

Returns
str representing the data structure type

Reimplemented from bridges.element.Element.

Reimplemented in bridges.circ_dl_element.CircDLelement, bridges.circ_sl_element.CircSLelement, bridges.dl_element.DLelement, and bridges.ml_element.MLelement.

◆ get_list_elements()

bridges.sl_element.SLelement.get_list_elements (   self,
  nodes 
)

Get the elements of the list (for internal use only)

Parameters
nodesa vector of the nodes in the list
Returns
elements of list

Reimplemented in bridges.ml_element.MLelement.

◆ iterator()

bridges.sl_element.SLelement.iterator (   self)

◆ list_helper()

bridges.sl_element.SLelement.list_helper (   start)

helper method for graph adjacency list

Member Data Documentation

◆ _next

bridges.sl_element.SLelement._next
protected

Property Documentation

◆ next

bridges.sl_element.SLelement.next = property
static

Getter for element following this element.

Returns
SLelement

◆ value

bridges.sl_element.SLelement.value = property
static

Getter for the SLelement value to hold.

Returns
Element

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