package components.queue; import components.sequence.Sequence; import components.sequence.Sequence1L; /** * {@code Queue} represented as a {@code Sequence} of entries, with * implementations of primary methods. * * @param * type of {@code Queue} entries * @correspondence this = $this.entries */ public class Queue3 extends QueueSecondary { /* * Private members -------------------------------------------------------- */ /** * Entries included in {@code this}. */ private Sequence entries; /** * Creator of initial representation. */ private void createNewRep() { this.entries = new Sequence1L(); } /* * Constructors ----------------------------------------------------------- */ /** * No-argument constructor. */ public Queue3() { this.createNewRep(); } /* * Standard methods removed to reduce clutter... */ /* * Kernel methods --------------------------------------------------------- */ @Override public final void enqueue(T x) { assert x != null : "Violation of: x is not null"; // TODO - fill in body } @Override public final T dequeue() { assert this.length() > 0 : "Violation of: this /= <>"; // TODO - fill in body // This line added just to make the component compilable. return null; } @Override public final int length() { // TODO - fill in body // This line added just to make the component compilable. return 0; } /* * Iterator removed to reduce clutter... */ }