Class Stack.Entry

java.lang.Object
org.tquadrat.foundation.util.Stack.Entry
Enclosing class:
Stack<T>

@ClassVersion(sourceVersion="$Id: Stack.java 1061 2023-09-25 16:32:43Z tquadrat $") @API(status=STABLE, since="0.0.5") private final class Stack.Entry extends Object
The stack entries.
Note:
  • This class cannot be changed to a record (instead of being a class) because a record as an inner class is implicitly static, and that collides with the type argument <T> that is inherited from the surrounding class.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: Stack.java 1061 2023-09-25 16:32:43Z tquadrat $
Since:
0.0.5
UML Diagram
UML Diagram for "org.tquadrat.foundation.util.Stack.Entry"

UML Diagram for "org.tquadrat.foundation.util.Stack.Entry"

UML Diagram for "org.tquadrat.foundation.util.Stack.Entry"
  • Field Details

    • m_Head

      private final T m_Head
      The current head element.
    • m_Tail

      private final Stack<T>.Entry m_Tail
      The remaining elements.
  • Constructor Details

    • Entry

      public Entry(T head, Stack<T>.Entry tail)
      Creates a new Stack object.
      Parameters:
      head - The current head.
      tail - The current tail; may be null, indicating an empty tail.
  • Method Details

    • head

      public final T head()
      Returns the current head.
      Returns:
      The head.
    • tail

      public final Stack<T>.Entry tail()
      Returns the current tail.
      Returns:
      The tail.