Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | Protected Member Functions | Protected Attributes | Package Functions | Package Attributes | List of all members
bridges.base.MLelement< E > Class Template Reference
Inheritance diagram for bridges.base.MLelement< E >:
bridges.base.SLelement< E > bridges.base.Element< E > bridges.base.DataStruct

Detailed Description

@brief 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 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. This class extends SLelement (singly linked list element) to build multi-lists; Multilist elements contain a tag that indicates if the element is a sublist or not; If the element points to a sublist, then the sublist field is the beginning of this sublist. If not, the data field contains the user specified data item and list continues (getNext()/setNext()). As in singly linked elements, the next pointer points to the following list element of the list or a sublist. Multi-list elements contain a visualizer, for setting visual attributes, such as color, shape, opacity, size, which is necessary for displaying them in a visualization

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.

Parameters
EThe generic parameter object that is part of this element, representing either application specific data, or a pointer to a sublist.
See also
Example Tutorial at https://bridgesuncc.github.io/tutorials/MultiList.html
Author
Kalpathi Subramanian
Date
5/24/17, 7/14/19

Public Member Functions

 MLelement ()
 
 MLelement (String label, E e)
 
 MLelement (E e, MLelement< E > next)
 
 MLelement (MLelement< E > sublist, MLelement< E > next)
 
void setSubList (MLelement< E > sl)
 
MLelement getSubList ()
 
String getDataStructType ()
 
MLelement< E > getNext ()
 
void setTag (boolean t)
 
boolean getTag ()
 
String getDataStructureRepresentation ()
 
- Public Member Functions inherited from bridges.base.SLelement< E >
 SLelement ()
 
 SLelement (String label, E e)
 
 SLelement (E e, SLelement< E > next)
 
 SLelement (E e)
 
 SLelement (SLelement< E > next)
 
void setNext (SLelement< E > next)
 
String toString ()
 
Iterator< E > iterator ()
 
- Public Member Functions inherited from bridges.base.Element< E >
 Element ()
 Element constructor. More...
 
 Element (E val)
 the constructor of Element More...
 
 Element (String label, E val)
 Constructor of Element. More...
 
 Element (Element< E > original)
 performing deep copy of an element when needed More...
 
String getIdentifier ()
 
void setSize (double sz)
 
void setColor (Color col)
 
Color getColor ()
 
void setOpacity (float opacity)
 
double getOpacity ()
 
void setShape (String aShape)
 
ElementVisualizer getVisualizer ()
 
void setVisualizer (ElementVisualizer visualizer)
 
LinkVisualizer getLinkVisualizer (Element< E > el)
 Returns the Element's link visualizer object. More...
 
String getClassName ()
 
int compareTo (Element< E > e1)
 
boolean equals (Element< E > e1)
 
String getElementRepresentation ()
 
String getLinkRepresentation (LinkVisualizer lv, String src, String dest)
 
String getLabel ()
 
void setLabel (String label)
 
getValue ()
 
void setValue (E value)
 
double getSize ()
 
void setColor (String col)
 Change the element color. More...
 
String getShape ()
 
void setLocation (double locX, double locY)
 Set the location attributes of an element. More...
 
double getLocationX ()
 
double getLocationY ()
 

Protected Member Functions

void getListElements (Vector< Element< E >> nodes)
 
- Protected Member Functions inherited from bridges.base.Element< E >
void setLinkVisualizer (Element< E > el)
 Sets the link from this element to a new incoming element. More...
 
void removeLinkVisualizer (Element< E > el)
 Removes the link from this element to a new incoming element. More...
 
void validateVal (E value)
 

Protected Attributes

MLelement< E > sub_list = null
 
- Protected Attributes inherited from bridges.base.SLelement< E >
SLelement< E > next = null
 
- Protected Attributes inherited from bridges.base.DataStruct
String QUOTE = "\""
 

Package Functions

void getListElements_R (MLelement< E > list, Vector< Element< E >> nodes)
 

Package Attributes

boolean tag = false
 
- Package Attributes inherited from bridges.base.DataStruct
String COMMA = ","
 
String COLON = ":"
 
String OPEN_CURLY = "{"
 
String CLOSE_CURLY = "}"
 
String OPEN_PAREN = "("
 
String CLOSE_PAREN = ")"
 
String OPEN_BOX = "["
 
String CLOSE_BOX = "]"
 

Additional Inherited Members

- Static Package Attributes inherited from bridges.base.Element< E >
static Integer ids = 0
 

Constructor & Destructor Documentation

◆ MLelement() [1/4]

This constructor creates an MLelement object and sets the next pointer to null

◆ MLelement() [2/4]

bridges.base.MLelement< E >.MLelement ( String  label,
e 
)

This constructor creates an MLelement object of generic parameter object E, and label "label" and sets the next pointer to null

Parameters
labelthe label of MLelement that shows up on the Bridges visualization
ethe generic object that this MLelement will hold

◆ MLelement() [3/4]

bridges.base.MLelement< E >.MLelement ( e,
MLelement< E >  next 
)

Creates a new element with value "e" and sets the next pointer to the MLelement referenced by the "next" argument

Parameters
ethe generic object that this element will hold
nextthe element that should be assigned to the next pointer

◆ MLelement() [4/4]

bridges.base.MLelement< E >.MLelement ( MLelement< E >  sublist,
MLelement< E >  next 
)

Creates a new element and sets the next pointer to the MLelement "next"

Parameters
sublistpointer to the sublist
nextthe MLelement that should be assigned to the next pointer

Member Function Documentation

◆ getDataStructType()

String bridges.base.MLelement< E >.getDataStructType ( )

This method gets the data structure type

Returns
The date structure type as a string

Reimplemented from bridges.base.SLelement< E >.

◆ getDataStructureRepresentation()

String bridges.base.MLelement< E >.getDataStructureRepresentation ( )

Get the JSON representation of the the data structure

Returns
the JSON string of the element's representation

Reimplemented from bridges.base.SLelement< E >.

◆ getListElements()

void bridges.base.MLelement< E >.getListElements ( Vector< Element< E >>  nodes)
protected

Get the elements of the list - used internally for JSON construction

Parameters
nodesa vector of the ndoes in the list

Reimplemented from bridges.base.SLelement< E >.

◆ getListElements_R()

void bridges.base.MLelement< E >.getListElements_R ( MLelement< E >  list,
Vector< Element< E >>  nodes 
)
package

◆ getNext()

MLelement<E> bridges.base.MLelement< E >.getNext ( )

Retrieves the element following this element

Returns
MLelement<E> assigned to next

Reimplemented from bridges.base.SLelement< E >.

◆ getSubList()

MLelement bridges.base.MLelement< E >.getSubList ( )

Gets the sublist at this node, if it exists

Returns
the sublist head element, if it exists

◆ getTag()

boolean bridges.base.MLelement< E >.getTag ( )

Gets the tag of the element.

Returns
tag of the element

◆ setSubList()

void bridges.base.MLelement< E >.setSubList ( MLelement< E >  sl)

Sets the start of a new sublist. to the MLelement "next"

Parameters
slthe MLelement that is the beginning of a sublist

◆ setTag()

void bridges.base.MLelement< E >.setTag ( boolean  t)

Sets the tag of the element.

Parameters
[in]ttag

Member Data Documentation

◆ sub_list

MLelement<E> bridges.base.MLelement< E >.sub_list = null
protected

◆ tag

boolean bridges.base.MLelement< E >.tag = false
package

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