Package com.storedobject.chart
Class GraphData.Edge
java.lang.Object
com.storedobject.chart.AbstractStyle
com.storedobject.chart.LineStyle
com.storedobject.chart.GraphData.Edge
- All Implemented Interfaces:
ComponentProperty
- Enclosing class:
GraphData<N extends GraphData.Node>
Represents a directional edge between two nodes in a graph structure. Inherits
styling properties from the
LineStyle class, providing additional encoded
JSON representation that incorporates unique edge properties such as the edge's ID,
source node, and destination node.- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.chart.LineStyle
LineStyle.Type -
Method Summary
Modifier and TypeMethodDescriptionconnectTo(GraphData.Node target) Establishes a connection from the current destination node of thisEdgeto the specified target node by creating or retrieving an edge between them.voidEncode the JSON string with the properties of this.booleanRetrieves the destination node of this edge.Retrieves the source node of this edge.inthashCode()Methods inherited from class com.storedobject.chart.AbstractStyle
getColor, getOpacity, getShadow, setColor, setOpacity, setShadow
-
Method Details
-
connectTo
Establishes a connection from the current destination node of thisEdgeto the specified target node by creating or retrieving an edge between them.- Parameters:
target- The targetNodeto which a connection is to be made. May not be null.- Returns:
- The
Edgeobject representing the connection to the target node, ornullif the target node is null.
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Overrides:
encodeJSONin classLineStyle- Parameters:
sb- Encoded JSON string to be appended to this.
-
getSourceNode
Retrieves the source node of this edge.- Returns:
- The source
Nodeassociated with this edge.
-
getDestinationNode
Retrieves the destination node of this edge.- Returns:
- The
Nodeinstance that represents the destination of this edge.
-
hashCode
-
equals
-