Bridges-Java-2.3.2  2.3.2
Bridges(JavaAPI)
Public Member Functions | Protected Member Functions | List of all members
bridges.base.Element< E > Class Template Reference

This is the main superclass in BRIDGES for deriving a number of objects used in building arrays, lists, trees and graph data structures. More...

Inheritance diagram for bridges.base.Element< E >:
bridges.base.DataStruct bridges.base.ArrayElement< E > bridges.base.DLelement< E > bridges.base.SLelement< E > bridges.base.TreeElement< E > bridges.base.CircDLelement< E > bridges.base.CircSLelement< E > bridges.base.BinTreeElement< E > bridges.base.BSTElement< K, E > bridges.base.AVLTreeElement< K, E >

Public Member Functions

 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 getRepresentation ()
 
String getLabel ()
 
void setLabel (String label)
 
String arrangeLabel (String label, int wordNumber)
 
getValue ()
 
void setValue (E value)
 
String toString ()
 

Protected Member Functions

String getDataStructType ()
 
void validateVal (E value)
 
- Protected Member Functions inherited from bridges.base.DataStruct
abstract String getDataStructType ()
 

Additional Inherited Members

- Protected Attributes inherited from bridges.base.DataStruct
String QUOTE = "\""
 

Detailed Description

This is the main superclass in BRIDGES for deriving a number of objects used in building arrays, lists, trees and graph data structures.

DLelement, CircSLelement, CircDLelement, TreeElement, BinTreeElement, BSTElement, AVLTreeElement are all subclasses. Element contains visualizer objects (ElementVisualizer, LinkVisualizer) for specifying visual attributes. It also contains a label that is used in the visualization.

Author
Mihai Mehedint, Kalpathi Subramanian
Parameters
generic<E>

Constructor & Destructor Documentation

Element constructor creates an ElementVisualizer object sets a unique identifier for the current Element normally used from subclasses

bridges.base.Element< E >.Element ( val)

the constructor of Element

Parameters
valwill be used to construct Element
bridges.base.Element< E >.Element ( String  label,
val 
)

the constructor of Element

Parameters
labelthe string that is visible on the Bridges Visualization
valwill be used to construct Element
bridges.base.Element< E >.Element ( Element< E >  original)

performing deep copy of an element when needed

Parameters
originalthe Element that is to be copied

Member Function Documentation

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

Parameters
label
wordNumberin 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
Returns
int bridges.base.Element< E >.compareTo ( Element< E >  e1)

Comparison between 2 elements

Parameters
e1the Element to compare this with
Returns
0 if the 2 elements have the same label and the same identifier and a nonZero integer otherwise
boolean bridges.base.Element< E >.equals ( Element< E >  e1)

This method compares 2 Elements

Parameters
e1
Returns
boolean
String bridges.base.Element< E >.getClassName ( )

This method returns the name of the class

Returns
the class name "Element"
String bridges.base.Element< E >.getDataStructType ( )
protected
String bridges.base.Element< E >.getIdentifier ( )

this method returns the element's unique identifier

Returns
the string identifier
String bridges.base.Element< E >.getLabel ( )

This method returns the existing value of the label fields

Returns
the label of the Element that shows up on the Bridges Visualization
LinkVisualizer bridges.base.Element< E >.getLinkVisualizer ( Element< E >  el)

Returns the Element's link visualizer object that is linked to element el Element el – the element terminating the link

Returns
the link visualizer
String bridges.base.Element< E >.getRepresentation ( )

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 }

Returns
the encoded JSON string
E bridges.base.Element< E >.getValue ( )

this method returns the value E for the current Element

Returns
the value
ElementVisualizer bridges.base.Element< E >.getVisualizer ( )

Returns the Element's visualizer object

Returns
the visualizer
void bridges.base.Element< E >.setLabel ( String  label)

This method sets the label

Parameters
labelthe label to set
void bridges.base.Element< E >.setValue ( value)

This method sets the value field to the E argument value

Parameters
valuethe value to set
void bridges.base.Element< E >.setVisualizer ( ElementVisualizer  visualizer)

This method sets the visualizer object for the current element object

Parameters
visualizerthe visualizer to set
String bridges.base.Element< E >.toString ( )
void bridges.base.Element< E >.validateVal ( value)
protected

Validates the Element's value when the Element is created A non null value is expected this will be unnecessary after we modify the server

Parameters
ELementvalue

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