Package com.storedobject.chart
Class TreeData
java.lang.Object
com.storedobject.chart.TreeData
- All Implemented Interfaces:
ComponentPart,ComponentProperty,TreeDataProvider
An implementation of
TreeDataProvider.- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.chart.TreeDataProvider
TreeDataProvider.Label -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd children.Create and add a child.get(int index) Get the data at the given index.Stream<? extends TreeDataProvider> Get the child nodes.final longgetId()Each part should have a unique Id.final TreeDataProvider.LabelgetLabel(boolean create) Get the label for this tree node.final StringgetName()Get the name of this part.intGet the current serial number (Serial number used for internal purposes only).final NumbergetValue()Get data value.Remove children.voidsetLabel(TreeDataProvider.Label label) Set the label.voidsetSerial(int serial) Set a serial number (Serial number used for internal purposes only).voidSet the value for the tree-node.Methods 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, setName, setRenderingIndexMethods inherited from interface com.storedobject.chart.TreeDataProvider
encodeJSON, getItemStyle, validate
-
Constructor Details
-
TreeData
-
TreeData
-
-
Method Details
-
getName
Description copied from interface:ComponentPartGet the name of this part.- Specified by:
getNamein interfaceComponentPart- Returns:
- Name
-
getValue
Description copied from interface:TreeDataProviderGet data value.- Specified by:
getValuein interfaceTreeDataProvider- Returns:
- Value.
-
setValue
Set the value for the tree-node.- Parameters:
value- Value to be set. Could be null.
-
getChildren
Description copied from interface:TreeDataProviderGet the child nodes.- Specified by:
getChildrenin interfaceTreeDataProvider- Returns:
- Child nodes as a stream.
-
getId
public final long getId()Description copied from interface:ComponentPartEach part should have a unique Id. (It can be a final variable and can be set by callingID.newID().- Specified by:
getIdin interfaceComponentPart- Returns:
- Unique Id.
-
setSerial
public void setSerial(int serial) Description copied from interface:ComponentPartSet a serial number (Serial number used for internal purposes only). The implementation of this method must be in such a way that the serial number set here must be returned by theComponentPart.getSerial()method.- Specified by:
setSerialin interfaceComponentPart- Parameters:
serial- Serial number to set.
-
getSerial
public int getSerial()Description copied from interface:ComponentPartGet the current serial number (Serial number used for internal purposes only). The serial number set by theComponentPart.setSerial(int)method should be returned by this method.- Specified by:
getSerialin interfaceComponentPart- Returns:
- Current serial number.
-
add
-
add
-
remove
-
get
Get the data at the given index.- Parameters:
index- Index.- Returns:
- Data at the given index. Returns
nullfor out of bound indices.
-
getLabel
Description copied from interface:TreeDataProviderGet the label for this tree node.- Specified by:
getLabelin interfaceTreeDataProvider- Parameters:
create- Whether to create it if not exists.- Returns:
- Return the label.
-
setLabel
Set the label.- Parameters:
label- Label to be set.
-