Bridges-Python  3.4.4
Bridges(Python API)
Public Member Functions | List of all members
bridges.dl_element.DLelement Class Reference
Inheritance diagram for bridges.dl_element.DLelement:
bridges.sl_element.SLelement bridges.element.Element bridges.circ_dl_element.CircDLelement

Detailed Description

This class is used to create doubly linked element objects.

This class extends Element and takes a generic parameter <E> representing application specific data. This element forms the basic building block for doubly linked lists. Doubly linked elements have two links, "next" and "previous", that point to the previous and succeeding nodes 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, such as in linked lists, between the current element and its next or previous nodes.

Author
Mihai Mehedint, Kalpathi Subramanian
Date
2018, 6/24/19
See also
Doubly Linked List tutorial : https://bridgesuncc.github.io/tutorials/DoublyLinkedList.html

Public Member Functions

None __init__ (self, *args, **kwargs)
 Constructor for DLelement. More...
 
str get_data_structure_type (self)
 This method gets the data structure type. More...
 
def next (self)
 Getter for the next element in Dlelement. More...
 
def next (self, el)
 Setter for the next element. More...
 
def prev (self)
 Getter for the prev element in Dlelement. More...
 
def prev (self, el)
 Setter for the prev element. More...
 
dict get_data_structure_representation (self)
 Getter for the json representation of this list. More...
 
def reverse_iterator (self)
 This iterator is used with range loops. More...
 
- Public Member Functions inherited from bridges.sl_element.SLelement
None __init__ (self, **kwargs)
 Conctructor for SLelement object. 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)
 helper method for graph adjacency list More...
 
def get_list_elements (self, nodes)
 Get the elements of the list (for internal use only) More...
 
def iterator (self)
 used for range loops More...
 
- Public Member Functions inherited from bridges.element.Element
str identifier (self)
 Getter for the element identifier. More...
 
None identifier (self, int id)
 Setter for the element identifier. More...
 
ElementVisualizer visualizer (self)
 Getter for the element visualizer. More...
 
None visualizer (self, ElementVisualizer vis)
 Setter function for this element visualizer. More...
 
LinkVisualizer get_link_visualizer (self, el)
 
None set_link_visualizer (self, el)
 Setter for the link visualizer of this element. More...
 
None 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...
 
int id (self)
 Get numer of ids of element object. More...
 
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__()

None bridges.dl_element.DLelement.__init__ (   self,
args,
**  kwargs 
)

Constructor for DLelement.

       (object) e: the genereic application specific object that DLelement is holding
Parameters
nextthe DLelement that should be assigned to the next pointer
prevthe DLelement that should be assigned to the prev pointer (str) label: the label for this DLelement
Return
None

Member Function Documentation

◆ get_data_structure_representation()

dict bridges.dl_element.DLelement.get_data_structure_representation (   self)

Getter for the json representation of this list.

Returns
dict representing the JSON format

Reimplemented from bridges.sl_element.SLelement.

◆ get_data_structure_type()

str bridges.dl_element.DLelement.get_data_structure_type (   self)

This method gets the data structure type.

Returns
str representing the data structure type

Reimplemented from bridges.sl_element.SLelement.

Reimplemented in bridges.circ_dl_element.CircDLelement.

◆ next() [1/2]

def bridges.dl_element.DLelement.next (   self)

Getter for the next element in Dlelement.

Returns
element pointed to by this element

Reimplemented from bridges.sl_element.SLelement.

Reimplemented in bridges.circ_dl_element.CircDLelement.

◆ next() [2/2]

def bridges.dl_element.DLelement.next (   self,
  el 
)

Setter for the next element.

Parameters
elelement to be set
Returns
None

Reimplemented from bridges.sl_element.SLelement.

Reimplemented in bridges.circ_dl_element.CircDLelement.

◆ prev() [1/2]

def bridges.dl_element.DLelement.prev (   self)

Getter for the prev element in Dlelement.

Returns
element that is prior to this element

Reimplemented in bridges.circ_dl_element.CircDLelement.

◆ prev() [2/2]

def bridges.dl_element.DLelement.prev (   self,
  el 
)

Setter for the prev element.

Parameters
elelement to be set
Returns
None

Reimplemented in bridges.circ_dl_element.CircDLelement.

◆ reverse_iterator()

def bridges.dl_element.DLelement.reverse_iterator (   self)

This iterator is used with range loops.

Reimplemented in bridges.circ_dl_element.CircDLelement.


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