Class NetworkNode<MoleculeType>
java.lang.Object
org.openscience.cdk.tools.scaffold.ScaffoldNodeBase<MoleculeType>
org.openscience.cdk.tools.scaffold.NetworkNode<MoleculeType>
- Type Parameters:
MoleculeType
- As MoleculeType, any data type can be defined. In our scenario, the node contains a CDK IAtomContainer.
The NetworkNodes are nodes from which a
ScaffoldNetwork
can be built.
It is used to organise the IAtomContainers and enables a relationship between the different objects.
A NetworkNode can have multiple children and parents.
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 network node, i.e. links it to a node on the level below.void
addParent
(NetworkNode<MoleculeType> aParent) Add the parents node and add this node as child to the parent node if not already done.int
getLevel()
Outputs the level on which the node is located in the graph structure.Get the parents of the node.boolean
isOrphan()
Shows if the node has parents.void
setParents
(List<NetworkNode<MoleculeType>> aParents) Set the parents of the 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
-
NetworkNode
Creates a NetworkNode- Parameters:
aMolecule
- molecule of the NetworkNode
-
-
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 network 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
-
addParent
Add the parents node and add this node as child to the parent node if not already done.- Parameters:
aParent
- parent that are added- 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
-
getParents
Get the parents of the node.- Returns:
- parents node
-
setParents
Set the parents of the node.- Parameters:
aParents
- parents that are set- Throws:
NullPointerException
- if parameter is null
-