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
FieldsModifier and TypeFieldDescriptionprivate NodeThe childNodeto this oneprivate StringThe actual dataprivate intThe level of the Node (basically how many times you can callNode.getParent()from here)private NodeThe next siblingNodeto this oneprivate NodeThe parentNodeto this oneprivate NodeThe previous siblingNodeto this oneprivate StringThe name for the piece of data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNodeusing the specified parametersprivate voidChecks 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 parentNodeto this one -
child
The childNodeto this one -
prevSibling
The previous siblingNodeto this one -
nextSibling
The next siblingNodeto 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 parentNodeto this one- Returns:
- this, to continue building
-
child
- Parameters:
child- The childNodeto this one- Returns:
- this, to continue building
-
prevSibling
- Parameters:
prevSibling- The previous siblingNodeto this one- Returns:
- this, to continue building
-
nextSibling
- Parameters:
nextSibling- The next siblingNodeto this one- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for errors in the current parameters -
build
Builds a newNodeusing the specified parameters- Returns:
- A newly built
Node
-