Klasse LinkedListNode<E>
java.lang.Object
ch.nolix.core.container.linkedlist.LinkedListNode<E>
- Typparameter:
E- is the type of the element of aLinkedListNode.
A
LinkedListNode contains an element and can have a next node.- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifikator und TypMethodeBeschreibungbooleanbooleanbooleanvoidRemoves the next node of the currentLinkedListNode.voidsetElement(E element) Sets the element of the currentLinkedListNode.voidsetNextNode(LinkedListNode<E> nextNode) Sets the next node of the currentLinkedListNode.voidSwaps the element of the currentLinkedListNodewith the element of the next node of the currentLinkedListNode.static <T> LinkedListNode<T> withElement(T element)
-
Methodendetails
-
withElement
- Typparameter:
T- is the type of the given element.- Parameter:
element-- Gibt zurück:
- a new
LinkedListNodewith the given element. - Löst aus:
RuntimeException- if the given element is null.
-
contains
- Parameter:
selector-- Gibt zurück:
- true if the current
LinkedListNodecontains an element the given selector selects, false otherwise.
-
contains
- Parameter:
element-- Gibt zurück:
- true if the current
LinkedListNodecontains the given element, false otherwise.
-
getElement
- Gibt zurück:
- the element of the current
LinkedListNode.
-
getNextNode
- Gibt zurück:
- the next node of the current
LinkedListNode. - Löst aus:
RuntimeException- if the currentLinkedListNodedoes not have a next node.
-
hasNextNode
public boolean hasNextNode()- Gibt zurück:
- true if the current
LinkedListNodehas a next node, false otherwise.
-
removeNextNode
public void removeNextNode()Removes the next node of the currentLinkedListNode. -
setElement
Sets the element of the currentLinkedListNode.- Parameter:
element-- Löst aus:
RuntimeException- if the given element is null.
-
setNextNode
Sets the next node of the currentLinkedListNode.- Parameter:
nextNode-- Löst aus:
RuntimeException- if the given next node is null.
-
swapElementWithNextNode
public void swapElementWithNextNode()Swaps the element of the currentLinkedListNodewith the element of the next node of the currentLinkedListNode.- Löst aus:
ArgumentDoesNotHaveAttributeException- if the currentLinkedListNodedoes not have a next node.
-