public abstract class Node extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
isRoot |
protected Node |
mother |
protected int |
nodeIndex |
Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
fillData(Object target,
int pos,
int len)
Write this node's data into the target object at pos, making sure that exactly len data are written.
|
abstract Object |
getAllData()
Get all the data at or below this node.
|
String |
getDecisionPath() |
Node |
getMother()
Get the mother node of this node
|
int |
getNodeIndex()
Get the index of this node in the mother's array of daughters
|
abstract int |
getNumberOfData()
Count all the data available at and below this node.
|
abstract int |
getNumberOfNodes()
Count all the nodes at and below this node.
|
Node |
getRootNode() |
boolean |
isDecisionNode() |
boolean |
isDirectedGraphNode() |
boolean |
isLeafNode() |
boolean |
isRoot()
Get the setting of isRoot
|
void |
setIsRoot(boolean isRoot)
Set isRoot to the given value
|
void |
setMother(Node node,
int nodeIndex)
set the mother node of this node, and remember this node's index in mother.
|
String |
toString(String prefix) |
protected boolean isRoot
protected Node mother
protected int nodeIndex
public void setMother(Node node, int nodeIndex)
node
- the mother nodenodeIndex
- the index of this node in the mother node's list of daughterspublic Node getMother()
public int getNodeIndex()
public void setIsRoot(boolean isRoot)
isRoot
- the new value of isRootpublic boolean isRoot()
public boolean isDecisionNode()
public boolean isLeafNode()
public boolean isDirectedGraphNode()
public Node getRootNode()
public String getDecisionPath()
public abstract int getNumberOfNodes()
public abstract int getNumberOfData()
public abstract Object getAllData()
protected abstract void fillData(Object target, int pos, int len)
target
- the object to write to, usually an array.pos
- the position in the target at which to start writinglen
- the amount of data items to write, usually equals getNumberOfData().Copyright © 2000–2016 DFKI GmbH. All rights reserved.