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 interfaceILinkedNoderepresents 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 firstILinkedNodeobjectILinkedNode<T>getNext()Gets the next objectdefault intgetNextCount()Gets the next count.default java.util.List<ILinkedNode<T>>getNextLinkedNodes()Gets all nextILinkedNodefrom the current linked nodeILinkedNode<T>getPrevious()Gets the previous objectdefault intgetPreviousCount()Gets the next count.default java.util.List<ILinkedNode<T>>getPreviousLinkedNodes()Gets all previousILinkedNodefrom the current linked nodeTgetValue()Gets the valuedefault booleanhasNext()Checks if this tree node has a next objectdefault booleanhasPrevious()Checks for previous objectdefault booleanisFirst()Checks if this is the first objectvoidsetNext(ILinkedNode<T> next)Sets the next objectvoidsetPrevious(ILinkedNode<T> previous)Sets the previous objectvoidsetValue(T value)Sets the value.default java.util.List<ILinkedNode<T>>toList()Transforms this linked node object to an orderedLinkedListwith all nodes
-
-
-
Method Detail
-
getFirst
default ILinkedNode<T> getFirst()
Gets the firstILinkedNodeobject- Returns:
- the first
ILinkedNodeobject
-
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 nextILinkedNodefrom the current linked node- Returns:
- all next
ILinkedNodefrom 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 previousILinkedNodefrom the current linked node- Returns:
- all previous
ILinkedNodefrom 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 orderedLinkedListwith all nodes- Returns:
- the ordered
LinkedListwith all nodes
-
-