public class Node
extends java.lang.Object
Constructor and Description |
---|
Node(java.lang.Character header)
Constructor using a Node using a Character converted as a String as
Header
|
Node(Node source)
Constructor using a Node to create a new One
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(int i,
Node n)
Add a child to the Node at the position i
|
Node |
getChild(int i)
Returns direct access to the Child at position i
|
java.lang.String |
getChildrenAsString()
|
int |
getChildrenNumber()
Gives the number of children that possess the Node
|
java.lang.Character |
getHeader()
Returns the Header of the Node
|
boolean |
isLeaf()
Checks if the Node has children
|
void |
removeChild(int i)
Deletes the Node at position i
|
void |
setHeader(java.lang.Character header)
Changes the Header of the Node with the given Character that will be
converted to a String
|
java.lang.String |
toString()
Returns the Node's Header
|
public Node(java.lang.Character header)
header
- Character to convert and use as Headerpublic Node(Node source)
source
- Node to copypublic void removeChild(int i) throws noNodeException
i
- Position of the Node to deletenoNodeException
- Throws this Exception if the Node to delete doesn't existpublic void addChild(int i, Node n)
i
- Position where the Node should be addedn
- Node to addpublic boolean isLeaf()
public Node getChild(int i)
i
- Position of the Node to returnpublic java.lang.String getChildrenAsString()
public void setHeader(java.lang.Character header)
header
- Character to use to change the Headerpublic java.lang.Character getHeader()
public int getChildrenNumber()
public java.lang.String toString()
toString
in class java.lang.Object