/**
 * Laboratorio de la semana 10: un stack acotado genérico.
 * Esqueleto: completen los métodos, su invariante y sus pruebas (BoundedStackTest.java).
 */
public class BoundedStack<E> {

    /** Crea un stack vacío con capacidad para capacity elementos (capacity > 0). */
    public BoundedStack(int capacity) {
        // TODO: validar capacity y crear el arreglo interno (ver los apuntes: new E[n] no compila)
    }

    /** Pone x arriba. Lanza IllegalStateException si el stack está lleno. */
    public void push(E x) {
        throw new UnsupportedOperationException("por implementar");
    }

    /** Saca y devuelve el elemento de arriba. Lanza IllegalStateException si está vacío. */
    public E pop() {
        throw new UnsupportedOperationException("por implementar");
    }

    /** El elemento de arriba, sin sacarlo. Lanza IllegalStateException si está vacío. */
    public E peek() {
        throw new UnsupportedOperationException("por implementar");
    }

    public int size() {
        throw new UnsupportedOperationException("por implementar");
    }

    public boolean isEmpty() {
        return size() == 0;
    }

    public boolean isFull() {
        throw new UnsupportedOperationException("por implementar");
    }
}
