Class Node.NodeBuilder
java.lang.Object
com.github.tadukoo.parsing.fileformat.Node.NodeBuilder
- Enclosing class:
- Node
Node Builder is used to build a
Node
. It has the following parameters:
Parameter | Description | Default or Required |
---|---|---|
title | The name for the piece of data | Required |
data | The actual data | Defaults to null/empty |
level | The level of the Node (basically how many times you can call Node.getParent() from here) |
Defaults to 0 |
parent | The parent Node to this one |
Defaults to null |
child | The child Node to this one |
Defaults to null |
prevSibling | The previous sibling Node to this one |
Defaults to null |
nextSibling | The next sibling Node to this one |
Defaults to null |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprivate Node
The childNode
to this oneprivate String
The actual dataprivate int
The level of the Node (basically how many times you can callNode.getParent()
from here)private Node
The next siblingNode
to this oneprivate Node
The parentNode
to this oneprivate Node
The previous siblingNode
to this oneprivate String
The name for the piece of data -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newNode
using the specified parametersprivate void
Checks for errors in the current parameterslevel
(int level) nextSibling
(Node nextSibling) prevSibling
(Node prevSibling)
-
Field Details
-
title
The name for the piece of data -
data
The actual data -
level
private int levelThe level of the Node (basically how many times you can callNode.getParent()
from here) -
parent
The parentNode
to this one -
child
The childNode
to this one -
prevSibling
The previous siblingNode
to this one -
nextSibling
The next siblingNode
to this one
-
-
Constructor Details
-
NodeBuilder
private NodeBuilder()Can't create NodeBuilder outside of Node
-
-
Method Details
-
title
- Parameters:
title
- The name for the piece of data- Returns:
- this, to continue building
-
data
- Parameters:
data
- The actual data- Returns:
- this, to continue building
-
level
- Parameters:
level
- The level of the Node (basically how many times you can callNode.getParent()
from here)- Returns:
- this, to continue building
-
parent
- Parameters:
parent
- The parentNode
to this one- Returns:
- this, to continue building
-
child
- Parameters:
child
- The childNode
to this one- Returns:
- this, to continue building
-
prevSibling
- Parameters:
prevSibling
- The previous siblingNode
to this one- Returns:
- this, to continue building
-
nextSibling
- Parameters:
nextSibling
- The next siblingNode
to this one- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for errors in the current parameters -
build
Builds a newNode
using the specified parameters- Returns:
- A newly built
Node
-