mdh.hephaestus2.containers
Interface IntStackReadOnly

All Known Implementing Classes:
IntStack

public interface IntStackReadOnly

A read-only interface to IntStack.

Author:
Copyright © 1998 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>

Method Summary
 boolean contains(int value)
           
 int get(int i)
           
 int indexOf(int value)
           
 boolean isEmpty()
           
 int lastIndexOf(int value)
           
 int peek()
          Returns top element without removing it.
 int size()
          The number of elements actually defined.
 String toString()
          Produces [#,...]
 

Method Detail

contains

public boolean contains(int value)

get

public int get(int i)
Returns:
the value at position i.

indexOf

public int indexOf(int value)

isEmpty

public boolean isEmpty()
Returns:
true if the IntStack is empty.

lastIndexOf

public int lastIndexOf(int value)

peek

public int peek()
Returns top element without removing it.


size

public int size()
The number of elements actually defined. Use this instead of data.length, as the latter counts the capacity, not how many are currently active.


toString

public String toString()
Produces [#,...]

Overrides:
toString in class Object