|
Bridges-Java-2.3.3
2.3.3
Bridges(JavaAPI)
|
This is the main superclass in BRIDGES for deriving a number of objects used in building arrays, lists, trees and graph data structures. More...
Public Member Functions | |
| String | getDataStructType () |
| Element () | |
| Element (E val) | |
| Element (String label, E val) | |
| Element (Element< E > original) | |
| String | getIdentifier () |
| ElementVisualizer | getVisualizer () |
| void | setVisualizer (ElementVisualizer visualizer) |
| LinkVisualizer | getLinkVisualizer (Element< E > el) |
| 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) |
| String | arrangeLabel (String label, int wordNumber) |
| E | getValue () |
| void | setValue (E value) |
| String | toString () |
Public Member Functions inherited from bridges.base.DataStruct | |
| abstract String | getDataStructType () |
Protected Member Functions | |
| void | setLinkVisualizer (Element< E > el) |
| void | removeLinkVisualizer (Element< E > el) |
| void | validateVal (E value) |
Additional Inherited Members | |
Protected Attributes inherited from bridges.base.DataStruct | |
| String | QUOTE = "\"" |
This is the main superclass in BRIDGES for deriving a number of objects used in building arrays, lists, trees and graph data structures.
SLelement, DLelement, CircSLelement, CircDLelement, TreeElement, BinTreeElement, BSTElement, CircSLelement, CircDLelement, AVLTreeElement are all subclasses (see class hierarchy above). Element contains two visualizer objects (ElementVisualizer, LinkVisualizer) for specifying visual attributes for nodes and links respectively. It also contains a label that that can be displayed in BRIDGES visualizations.
All the tutorials under
http://bridgesuncc.github.io/Hello_World_Tutorials/Overview.html
illustrate examples of using different types of Element objects and how to manipulate their visual attributes.
| generic | <E> Elements are defined with an application specific generic parameter, that is defined by the user. These can be any legal Java type and manipulated using setValue()/getValue() methods. For more information on Java generics, see for example, https://docs.oracle.com/javase/tutorial/java/generics/types.html |
| bridges.base.Element< E >.Element | ( | ) |
Element constructor creates an ElementVisualizer object sets a unique identifier for the current Element normally used from subclasses
| bridges.base.Element< E >.Element | ( | E | val | ) |
| bridges.base.Element< E >.Element | ( | String | label, |
| E | val | ||
| ) |
| bridges.base.Element< E >.Element | ( | Element< E > | original | ) |
performing deep copy of an element when needed
| original | the Element that is to be copied |
| String bridges.base.Element< E >.arrangeLabel | ( | String | label, |
| int | wordNumber | ||
| ) |
This method formats the label string using a predefine pattern (DIVIDE_KEY) and replaces the pattern with the string characters hold by the INSERT_STRING global variable
| label | the input label string |
| wordNumber | in very long strings in the case where the whitespace \s is chosen as a key the wordNumber can be set to replace the whitespace with a newline character \n at a given number of words (every second or third word) The default value is 0. In most situations we want to replace all patterns found. for more complex patterns the key must be changed like so "((John) (.+?))" returns "John firstWordAfterJohn": John writes, John doe, John eats etc. (\w) matches any word (\s) one white space (\s*) zero or more white spaces, (\s+) one or more |
| int bridges.base.Element< E >.compareTo | ( | Element< E > | e1 | ) |
Comparison between 2 elements
| e1 | the Element to compare this with |
| boolean bridges.base.Element< E >.equals | ( | Element< E > | e1 | ) |
This method compares 2 Elements
| e1 |
| String bridges.base.Element< E >.getClassName | ( | ) |
This method returns the name of the class
| String bridges.base.Element< E >.getDataStructType | ( | ) |
| String bridges.base.Element< E >.getElementRepresentation | ( | ) |
Internal code for getting the properties of the Element object. It produces (without the spaces or newlines): { "name": "Some label", "other CSS properties like color": any_JSON_value }
| String bridges.base.Element< E >.getIdentifier | ( | ) |
this method returns the element's unique identifier
| String bridges.base.Element< E >.getLabel | ( | ) |
This method returns the existing value of the label fields
| String bridges.base.Element< E >.getLinkRepresentation | ( | LinkVisualizer | lv, |
| String | src, | ||
| String | dest | ||
| ) |
Generate string representing the data structure of a list
| nodes | the list of nodes in the list |
Get the link visualizer representation, iterating through the link properties
| LinkVisualizer bridges.base.Element< E >.getLinkVisualizer | ( | Element< E > | el | ) |
Returns the Element's link visualizer object
The link visualizer object links this element to another element, which is specified by the argument to this method. This method is typically used to set the visual attributes of the links, such as in graphs or binary tree structures.
Element el – the element terminating the link
| E bridges.base.Element< E >.getValue | ( | ) |
This method returns the generic parameter value held in the element.
| ElementVisualizer bridges.base.Element< E >.getVisualizer | ( | ) |
Returns the Element's visualizer object
|
protected |
| void bridges.base.Element< E >.setLabel | ( | String | label | ) |
This method sets the label
| label | the label to set |
|
protected |
Sets the link from this element to a new incoming element
| el | the element to be linked to. |
| void bridges.base.Element< E >.setValue | ( | E | value | ) |
This method sets the generic parameter value for this element.
| value | the value to set |
| void bridges.base.Element< E >.setVisualizer | ( | ElementVisualizer | visualizer | ) |
This method sets the visualizer object for the current element object
| visualizer | the visualizer to set |
| String bridges.base.Element< E >.toString | ( | ) |
|
protected |
1.8.10