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 TypeMethodDescriptionvoidEncode the JSON string with the properties of this.getValue()Returns the numerical value held by this node.voidSets 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, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setRenderingIndex
-
Constructor Details
-
ValueNode
Constructs aValueNodeinstance 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
ValueNodewith the updated value.
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Overrides:
encodeJSONin classGraphData.Node- Parameters:
sb- Encoded JSON string to be appended to this.
-