Class TreeNode<MoleculeType>
java.lang.Object
org.openscience.cdk.tools.scaffold.ScaffoldNodeBase<MoleculeType>
org.openscience.cdk.tools.scaffold.TreeNode<MoleculeType>
- Type Parameters:
MoleculeType
- As MoleculeType, any data type can be defined. In our scenario, the node contains a CDK IAtomContainer.
The TreeNodes are nodes from which a
ScaffoldTree
can be built.
It is used to organise the IAtomContainers and enables a relationship between the different objects.
A TreeNode can have different children but only one parent.
The parents are the smaller parent scaffolds.- Version:
- 1.0.0.0
- Author:
- Julian Zander, Jonas Schaub (zanderjulian@gmx.de, jonas.schaub@uni-jena.de)
-
Field Summary
Fields inherited from class org.openscience.cdk.tools.scaffold.ScaffoldNodeBase
children, molecule, nonVirtualOriginSmilesList, originSmilesList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChild
(MoleculeType aMolecule) Adds a child to the tree node, i.e. links it to a node on the level below.int
getLevel()
Outputs the level on which the node is located in the graph structure.Get the parent node.boolean
isOrphan()
Shows if the node has parents.void
setParent
(TreeNode<MoleculeType> aParent) Set the parent node.Methods inherited from class org.openscience.cdk.tools.scaffold.ScaffoldNodeBase
addNonVirtualOriginSmiles, addOriginSmiles, getChildren, getMolecule, getNonVirtualOriginCount, getNonVirtualOriginSmilesList, getOriginCount, getOriginSmilesList, hasNonVirtualOriginSmiles, isLeaf, setChildren, setMolecule, setNonVirtualOriginSmilesList, setOriginSmilesList
-
Constructor Details
-
TreeNode
Constructor- Parameters:
aMolecule
- molecule of the TreeNode
-
-
Method Details
-
isOrphan
public boolean isOrphan()Shows if the node has parents. Description copied fromScaffoldNodeBase
.- Specified by:
isOrphan
in classScaffoldNodeBase<MoleculeType>
- Returns:
- Whether the node has parents
-
addChild
Adds a child to the tree node, i.e. links it to a node on the level below. Description copied fromScaffoldNodeBase
.- Specified by:
addChild
in classScaffoldNodeBase<MoleculeType>
- Parameters:
aMolecule
- Molecule of the child- Returns:
- Node of the child
- Throws:
NullPointerException
- if parameter is null
-
getLevel
public int getLevel()Outputs the level on which the node is located in the graph structure. The level indicates the distance to the root (node without parents) and is determined by setting the level of the parent node + 1. The root itself has the level 0. The level is therefore dependent on the data structure and does not have to be set. Description copied fromScaffoldNodeBase
.- Specified by:
getLevel
in classScaffoldNodeBase<MoleculeType>
- Returns:
- level of the node in the entire node collection
-
getParent
Get the parent node.- Returns:
- parent node
-
setParent
Set the parent node.- Parameters:
aParent
- parent that are set- Throws:
NullPointerException
- if parameter is null
-