Class LinkedNode<T>
java.lang.Object
io.github.astrapi69.gen.tree.binary.LinkedNode<T>
- Type Parameters:
T- the generic type of the value
The class
LinkedNode is a representation of a binary tree node and can have only one next
element and one previous element and a current value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFirst()Gets the firstLinkedNodeobjectintGets the next count.List<LinkedNode<T>>Gets all nextLinkedNodefrom the current linked nodebooleanhasNext()Checks if this tree node has a next objectbooleanChecks for previous objectbooleanisFirst()Checks if this is the first objectList<LinkedNode<T>>toList()Transforms this linked node object to an orderedLinkedListwith all nodes
-
Constructor Details
-
LinkedNode
Instantiates a newLinkedNode- Parameters:
value- the value
-
-
Method Details
-
getFirst
Gets the firstLinkedNodeobject- Returns:
- the first
LinkedNodeobject
-
hasPrevious
public boolean hasPrevious()Checks for previous object- Returns:
- true, if successful
-
isFirst
public boolean isFirst()Checks if this is the first object- Returns:
- true, if is first
-
getNextCount
public int getNextCount()Gets the next count.- Returns:
- the next count
-
getNextLinkedNodes
Gets all nextLinkedNodefrom the current linked node- Returns:
- all next
LinkedNodefrom the current linked node
-
hasNext
public boolean hasNext()Checks if this tree node has a next object- Returns:
- true, if successful
-
toList
Transforms this linked node object to an orderedLinkedListwith all nodes- Returns:
- the ordered
LinkedListwith all nodes
-