Package io.github.astrapi69.tree.api
Interface ILinkedNode<T>
-
- Type Parameters:
T
- the generic type of the value
- All Known Implementing Classes:
LinkedNode
public interface ILinkedNode<T>
The interfaceILinkedNode
represents a chainable object with a generic value
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ILinkedNode<T>
getFirst()
Gets the firstILinkedNode
objectILinkedNode<T>
getNext()
Gets the next objectdefault int
getNextCount()
Gets the next count.default java.util.List<ILinkedNode<T>>
getNextLinkedNodes()
Gets all nextILinkedNode
from the current linked nodeILinkedNode<T>
getPrevious()
Gets the previous objectdefault int
getPreviousCount()
Gets the next count.default java.util.List<ILinkedNode<T>>
getPreviousLinkedNodes()
Gets all previousILinkedNode
from the current linked nodeT
getValue()
Gets the valuedefault boolean
hasNext()
Checks if this tree node has a next objectdefault boolean
hasPrevious()
Checks for previous objectdefault boolean
isFirst()
Checks if this is the first objectvoid
setNext(ILinkedNode<T> next)
Sets the next objectvoid
setPrevious(ILinkedNode<T> previous)
Sets the previous objectvoid
setValue(T value)
Sets the value.default java.util.List<ILinkedNode<T>>
toList()
Transforms this linked node object to an orderedLinkedList
with all nodes
-
-
-
Method Detail
-
getFirst
default ILinkedNode<T> getFirst()
Gets the firstILinkedNode
object- Returns:
- the first
ILinkedNode
object
-
getNext
ILinkedNode<T> getNext()
Gets the next object- Returns:
- the next object
-
getNextCount
default int getNextCount()
Gets the next count.- Returns:
- the next count
-
getNextLinkedNodes
default java.util.List<ILinkedNode<T>> getNextLinkedNodes()
Gets all nextILinkedNode
from the current linked node- Returns:
- all next
ILinkedNode
from the current linked node
-
getPrevious
ILinkedNode<T> getPrevious()
Gets the previous object- Returns:
- the previous object
-
getPreviousCount
default int getPreviousCount()
Gets the next count.- Returns:
- the next count
-
getPreviousLinkedNodes
default java.util.List<ILinkedNode<T>> getPreviousLinkedNodes()
Gets all previousILinkedNode
from the current linked node- Returns:
- all previous
ILinkedNode
from the current linked node
-
getValue
T getValue()
Gets the value- Returns:
- the value
-
hasNext
default boolean hasNext()
Checks if this tree node has a next object- Returns:
- true, if successful
-
hasPrevious
default boolean hasPrevious()
Checks for previous object- Returns:
- true, if successful
-
isFirst
default boolean isFirst()
Checks if this is the first object- Returns:
- true, if is first
-
setNext
void setNext(ILinkedNode<T> next)
Sets the next object- Parameters:
next
- the new next object
-
setPrevious
void setPrevious(ILinkedNode<T> previous)
Sets the previous object- Parameters:
previous
- the new previous object
-
setValue
void setValue(T value)
Sets the value.- Parameters:
value
- the new value
-
toList
default java.util.List<ILinkedNode<T>> toList()
Transforms this linked node object to an orderedLinkedList
with all nodes- Returns:
- the ordered
LinkedList
with all nodes
-
-