de.caff.generics

## Class CopierFStackImpl.Empty<T>

- java.lang.Object
- - de.caff.generics.CopierFStackImpl.Empty<T>

- Type Parameters:
    `T` - element type
  All Implemented Interfaces:
    FStack<T>, java.lang.Iterable<T>
  Enclosing class:
    CopierFStackImpl<T>

      static class CopierFStackImpl.Empty<T>
      extends java.lang.Object
      implements FStack<T>

  Empty copier stack implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Empty(Copier<T> copier)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isEmpty()` Is this stack empty?
    `FStack<T>` | `pop()` Pop the stack.
    `FStack<T>` | `push(T elem)` Push an element to the top of the stack.
    `int` | `size()` Get the size of this stack.
    `T` | `top()` Get the top element of the stack.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.caff.generics.FStack

      `empty, empty, emptyCopyable, from, from, fromCopyable, iterator, pushAll, reverseFrom, reverseFrom, reverseFromCopyable, reversePushAll`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### Empty

          public Empty(Copier<T> copier)

      Constructor.
      Parameters:
        `copier` - copier of this item

  - ### Method Detail

    - #### top

          public T top()

      Description copied from interface: `FStack`
      Get the top element of the stack.
      Specified by:
        `top` in interface `FStack<T>`
      Returns:
        top element

    - #### push

          @NotNull
          public FStack<T> push(T elem)

      Description copied from interface: `FStack`
      Push an element to the top of the stack. This will not change this stack but return a new stack with the given element at the `FStack.top()`.
      Specified by:
        `push` in interface `FStack<T>`
      Parameters:
        `elem` - element to push to the stack
      Returns:
        new stack with `elem` at the top and the same elements as this stack below it

    - #### pop

          @NotNull
          public FStack<T> pop()

      Description copied from interface: `FStack`
      Pop the stack. This will remove the top-most element from the stack and return a new stack without it.
      Specified by:
        `pop` in interface `FStack<T>`
      Returns:
        a new stack without the top element of this stack

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `FStack`
      Is this stack empty? An empty stack does not have a top element, therefore `FStack.top()` and `FStack.pop()` are not allowed and will result in `EmptyStackException`s
      Specified by:
        `isEmpty` in interface `FStack<T>`
      Returns:

    - #### size

          public int size()

      Description copied from interface: `FStack`
      Get the size of this stack. This is an expensive operation!
      Specified by:
        `size` in interface `FStack<T>`
      Returns:
        number of elements in this stack