1package com.osroyale.util;
3import java.util.Collection;
4import java.util.Iterator;
7public class SortedQueue<E>
implements Queue<E> {
9 private Object[] elements;
11 public SortedQueue(
int initial) {
12 elements =
new Object[initial];
16 public Iterator<E> iterator() {
21 public boolean contains(Object other) {
26 public boolean containsAll(Collection<?> collection) {
31 public boolean isEmpty() {
41 public Object[] toArray() {
46 public <T> T[] toArray(T[] array) {
51 public boolean remove(Object other) {
61 public boolean removeAll(Collection<?> collection) {
66 public boolean retainAll(Collection<?> collection) {
71 public boolean add(E element) {
76 public boolean offer(E element) {
81 public boolean addAll(Collection<? extends E> collection) {