Bridges-Java-3.0.1  3.0.1
Bridges(JavaAPI)
Public Member Functions | Protected Member Functions | Protected 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

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. 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 sublist.

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.

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

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)
 
String getDataStructType ()
 
SLelement< E > getNext ()
 
void setNext (SLelement< E > next)
 
String toString ()
 
String getDataStructureRepresentation ()
 
Iterator< SLelement< E > > iterator ()
 
- Public Member Functions inherited from bridges.base.Element< E >
String getDataStructType ()
 Get the Element type name. More...
 
 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 getDataStructureRepresentation ()
 
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 ()
 
String toString ()
 
- Public Member Functions inherited from bridges.base.DataStruct
abstract String getDataStructType ()
 
abstract String getDataStructureRepresentation ()
 

Protected Member Functions

void getListElements (Vector< Element< E >> nodes)
 
- Protected Member Functions inherited from bridges.base.SLelement< E >
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 = "\""
 

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
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

◆ getDataStructureRepresentation()

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

◆ getListElements()

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

◆ getNext()

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

Retrieves the element following this element

Returns
MLelement<E> assigned to next

◆ 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

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