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

Detailed Description

This class can be used to instantiate Circular Doubly Linked List Elements.

Structurally they are the same as doubly linked elements except that each node constructed with the next and the previous pointers points to itself.

User's implementation of the circularly linked list needs to ensure that the last node's next pointer points to the first node and the first node's previous pointer points to the last node, as the visualization generation is dependent on this.

Elements have labels (string) that are displayed on the visualization. Elements take an generic object E as a user defined parameter, which can be any native type or object.

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, between the element and its previous or next nodes.

Author
Kalpathi Subramanian, Mathhew McQuaigue
Date
7/17/16, 1/16/17 7/23/19, 2021

Circular doubly linked list tutorial: https://bridgesuncc.github.io/tutorials/CircularDoublyLinkedList.html

Public Member Functions

None __init__ (self, **kwargs)
 Constructor for an Circularly Doubly Linked Element. More...
 
str get_data_structure_type (self)
 Gets the data structure type. More...
 
def next (self)
 Getter for the next element of this CircDLelement. More...
 
None next (self, next)
 Setter for the next element for this CircDLelement. More...
 
def prev (self)
 Getter for the prev element of this CircDLelement. More...
 
None prev (self, prev)
 Setter for the prev element of this CircDLelement. More...
 
def iterator (self)
 list iterator to be used with range loops More...
 
def reverse_iterator (self)
 list reverse iterator to be used with range loops More...
 
- Public Member Functions inherited from bridges.dl_element.DLelement
None __init__ (self, *args, **kwargs)
 Constructor for DLelement. More...
 
dict get_data_structure_representation (self)
 Getter for the json representation of this list. More...
 
- Public Member Functions inherited from bridges.sl_element.SLelement
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...
 
- 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...
 

Public Attributes

 next
 
 prev
 
- Public Attributes inherited from bridges.element.Element
 color
 
 opacity
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ __init__()

None bridges.circ_dl_element.CircDLelement.__init__ (   self,
**  kwargs 
)

Constructor for an Circularly Doubly Linked Element.

Parameters
labelTHe label for this CircDLelement
ethe generic element object that this CircDLelement will hold
nextthe next DLelement that should be assigned to the next pointer
prevTHe previous DLelement that should be assigned to the next pointer
Returns
None

Reimplemented from bridges.sl_element.SLelement.

Member Function Documentation

◆ get_data_structure_type()

str bridges.circ_dl_element.CircDLelement.get_data_structure_type (   self)

Gets the data structure type.

Returns
None

Reimplemented from bridges.dl_element.DLelement.

◆ iterator()

def bridges.circ_dl_element.CircDLelement.iterator (   self)

list iterator to be used with range loops

Reimplemented from bridges.sl_element.SLelement.

◆ next() [1/2]

def bridges.circ_dl_element.CircDLelement.next (   self)

Getter for the next element of this CircDLelement.

Returns
DLelement the following element

Reimplemented from bridges.dl_element.DLelement.

◆ next() [2/2]

None bridges.circ_dl_element.CircDLelement.next (   self,
  next 
)

Setter for the next element for this CircDLelement.

       (DLelement) next: the next element to be set
Returns
None

Reimplemented from bridges.dl_element.DLelement.

◆ prev() [1/2]

def bridges.circ_dl_element.CircDLelement.prev (   self)

Getter for the prev element of this CircDLelement.

Returns
DLelement the prev element in the list

Reimplemented from bridges.dl_element.DLelement.

◆ prev() [2/2]

None bridges.circ_dl_element.CircDLelement.prev (   self,
  prev 
)

Setter for the prev element of this CircDLelement.

       (DLelement) prev: The prev element to be set
Returns
None

Reimplemented from bridges.dl_element.DLelement.

◆ reverse_iterator()

def bridges.circ_dl_element.CircDLelement.reverse_iterator (   self)

list reverse iterator to be used with range loops

Reimplemented from bridges.dl_element.DLelement.

Member Data Documentation

◆ next

bridges.circ_dl_element.CircDLelement.next

◆ prev

bridges.circ_dl_element.CircDLelement.prev

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