Constructor and Description |
---|
Node(String key,
DataT data)
Creates a graph node.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(String childKey) |
List<String> |
children() |
DataT |
data() |
boolean |
hasChildren() |
String |
key() |
Graph<DataT,NodeT> |
owner() |
void |
removeChild(String childKey) |
void |
setOwner(Graph<DataT,NodeT> ownerGraph)
Sets reference to the graph owning this node.
|
public String key()
public DataT data()
public boolean hasChildren()
public void addChild(String childKey)
childKey
- add a child (neighbour) of this nodepublic void removeChild(String childKey)
childKey
- remove child (neighbour) of this nodepublic void setOwner(Graph<DataT,NodeT> ownerGraph)
ownerGraph
- the owning graphCopyright © 2019. All rights reserved.