Bridges-Java
3.4.3
Bridges(Java API)
|
@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.
E | The 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) | |
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) |
E | 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 |
bridges.base.MLelement< E >.MLelement | ( | ) |
This constructor creates an MLelement object and sets the next pointer to null
bridges.base.MLelement< E >.MLelement | ( | String | label, |
E | e | ||
) |
bridges.base.MLelement< E >.MLelement | ( | E | e, |
MLelement< E > | next | ||
) |
Creates a new element with value "e" and sets the next pointer to the MLelement referenced by the "next" argument
e | the generic object that this element will hold |
next | the element that should be assigned to the next pointer |
bridges.base.MLelement< E >.MLelement | ( | MLelement< E > | sublist, |
MLelement< E > | next | ||
) |
String bridges.base.MLelement< E >.getDataStructType | ( | ) |
This method gets the data structure type
Reimplemented from bridges.base.SLelement< E >.
String bridges.base.MLelement< E >.getDataStructureRepresentation | ( | ) |
Get the JSON representation of the the data structure
Reimplemented from bridges.base.SLelement< E >.
|
protected |
Get the elements of the list - used internally for JSON construction
nodes | a vector of the ndoes in the list |
Reimplemented from bridges.base.SLelement< E >.
|
package |
MLelement<E> bridges.base.MLelement< E >.getNext | ( | ) |
Retrieves the element following this element
Reimplemented from bridges.base.SLelement< E >.
MLelement bridges.base.MLelement< E >.getSubList | ( | ) |
Gets the sublist at this node, if it exists
boolean bridges.base.MLelement< E >.getTag | ( | ) |
Gets the tag of the element.
void bridges.base.MLelement< E >.setSubList | ( | MLelement< E > | sl | ) |
void bridges.base.MLelement< E >.setTag | ( | boolean | t | ) |
Sets the tag of the element.
[in] | t | tag |
|
protected |
|
package |