Package com.storedobject.chart
Class GraphData.ValueNode
java.lang.Object
com.storedobject.chart.GraphData.Node
com.storedobject.chart.GraphData.ValueNode
- All Implemented Interfaces:
ComponentPart
,ComponentProperty
- Enclosing class:
GraphData<N extends GraphData.Node>
The
ValueNode
class represents a type of Node
that holds a numerical value.
It extends the base functionality of the Node
class by adding a specific attribute
to store and manage a numerical value. This value can be encoded into a JSON format when
serializing the node.
This class is useful for scenarios where nodes in a graph have associated numerical properties
that need to be dynamically updated or serialized as part of its data.- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.chart.GraphData.Node
name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Encode the JSON string with the properties of this.getValue()
Returns the numerical value held by this node.void
Sets the numerical value for this node.Sets the numerical value for theValueNode
.Methods inherited from class com.storedobject.chart.GraphData.Node
connectTo, getCategory, getId, getName, getSerial, setCategory, setName, setSerial, streamEdges, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setRenderingIndex
-
Constructor Details
-
ValueNode
Constructs aValueNode
instance with the specified numerical value.- Parameters:
value
- Numerical value to be associated with this node.
-
-
Method Details
-
getValue
Returns the numerical value held by this node.- Returns:
- The numerical value as a
Number
.
-
setValue
-
value
Sets the numerical value for theValueNode
. The provided value is assigned to the node and this method returns the current instance to allow method chaining.- Parameters:
value
- The numerical value to be assigned to the node.- Returns:
- The current instance of
ValueNode
with the updated value.
-
encodeJSON
Description copied from interface:ComponentProperty
Encode the JSON string with the properties of this.- Specified by:
encodeJSON
in interfaceComponentProperty
- Overrides:
encodeJSON
in classGraphData.Node
- Parameters:
sb
- Encoded JSON string to be appended to this.
-