Class ArrayCharQueue

java.lang.Object
ch.hslu.exercises.sw02.ex4.ArrayCharQueue
All Implemented Interfaces:
CharQueue

public final class ArrayCharQueue extends Object implements CharQueue
  • Constructor Details

    • ArrayCharQueue

      public ArrayCharQueue()
  • Method Details

    • offer

      public void offer(char element)
      Description copied from interface: CharQueue
      Add a char to the head of the queue.
      Specified by:
      offer in interface CharQueue
      Parameters:
      element - the char to be added.
    • poll

      public char poll()
      Description copied from interface: CharQueue
      Get a char from the head of the queue.
      Specified by:
      poll in interface CharQueue
      Returns:
      the head of the queue
    • size

      public int size()
      Description copied from interface: CharQueue
      Get the current size of the queue.
      Specified by:
      size in interface CharQueue
      Returns:
      the size of the queue
    • toString

      public String toString()
      Overrides:
      toString in class Object