Klasse LinkedListNode<E>

java.lang.Object
ch.nolix.core.container.linkedlist.LinkedListNode<E>
Typparameter:
E - is the type of the element of a LinkedListNode.

public final class LinkedListNode<E> extends Object
A LinkedListNode contains an element and can have a next node.
Autor:
Silvan Wyss
  • Methodendetails

    • withElement

      public static <T> LinkedListNode<T> withElement(T element)
      Typparameter:
      T - is the type of the given element.
      Parameter:
      element -
      Gibt zurück:
      a new LinkedListNode with the given element.
      Löst aus:
      RuntimeException - if the given element is null.
    • contains

      public boolean contains(Predicate<E> selector)
      Parameter:
      selector -
      Gibt zurück:
      true if the current LinkedListNode contains an element the given selector selects, false otherwise.
    • contains

      public boolean contains(Object element)
      Parameter:
      element -
      Gibt zurück:
      true if the current LinkedListNode contains the given element, false otherwise.
    • getElement

      public E getElement()
      Gibt zurück:
      the element of the current LinkedListNode.
    • getNextNode

      public LinkedListNode<E> getNextNode()
      Gibt zurück:
      the next node of the current LinkedListNode.
      Löst aus:
      RuntimeException - if the current LinkedListNode does not have a next node.
    • hasNextNode

      public boolean hasNextNode()
      Gibt zurück:
      true if the current LinkedListNode has a next node, false otherwise.
    • removeNextNode

      public void removeNextNode()
      Removes the next node of the current LinkedListNode.
    • setElement

      public void setElement(E element)
      Sets the element of the current LinkedListNode.
      Parameter:
      element -
      Löst aus:
      RuntimeException - if the given element is null.
    • setNextNode

      public void setNextNode(LinkedListNode<E> nextNode)
      Sets the next node of the current LinkedListNode.
      Parameter:
      nextNode -
      Löst aus:
      RuntimeException - if the given next node is null.
    • swapElementWithNextNode

      public void swapElementWithNextNode()
      Swaps the element of the current LinkedListNode with the element of the next node of the current LinkedListNode.
      Löst aus:
      ArgumentDoesNotHaveAttributeException - if the current LinkedListNode does not have a next node.