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 thisEdge
to the specified target node by creating or retrieving an edge between them.void
Encode the JSON string with the properties of this.boolean
Retrieves the destination node of this edge.Retrieves the source node of this edge.int
hashCode()
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 thisEdge
to the specified target node by creating or retrieving an edge between them.- Parameters:
target
- The targetNode
to which a connection is to be made. May not be null.- Returns:
- The
Edge
object representing the connection to the target node, ornull
if the target node is null.
-
encodeJSON
Description copied from interface:ComponentProperty
Encode the JSON string with the properties of this.- Specified by:
encodeJSON
in interfaceComponentProperty
- Overrides:
encodeJSON
in classLineStyle
- Parameters:
sb
- Encoded JSON string to be appended to this.
-
getSourceNode
Retrieves the source node of this edge.- Returns:
- The source
Node
associated with this edge.
-
getDestinationNode
Retrieves the destination node of this edge.- Returns:
- The
Node
instance that represents the destination of this edge.
-
hashCode
-
equals
-