org.jmlspecs.samples.stacks
Class BoundedStack
java.lang.Object
org.jmlspecs.samples.stacks.BoundedStack
- All Implemented Interfaces:
- BoundedStackInterface, BoundedThing
- public class BoundedStack
- extends Object
- implements BoundedStackInterface
theItems
protected Object[] theItems
nextFree
protected int nextFree
maxSize
protected int maxSize
BoundedStack
public BoundedStack()
BoundedStack
public BoundedStack(int maxSize)
clone
public Object clone()
- Specified by:
clone in interface BoundedThing- Overrides:
clone in class Object
getSizeLimit
public int getSizeLimit()
- Specified by:
getSizeLimit in interface BoundedThing
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface BoundedThing
isFull
public boolean isFull()
- Specified by:
isFull in interface BoundedThing
pop
public void pop()
throws BoundedStackException
- Specified by:
pop in interface BoundedStackInterface
- Throws:
BoundedStackException
push
public void push(Object x)
throws BoundedStackException
- Specified by:
push in interface BoundedStackInterface
- Throws:
BoundedStackException
top
public Object top()
throws BoundedStackException
- Specified by:
top in interface BoundedStackInterface
- Throws:
BoundedStackException
toString
public String toString()
- Overrides:
toString in class Object
printStack
protected void printStack()
JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.