home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Excel / Sheet.jar / sheet / CellCalc$IntegerStack.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-09-03  |  915 b   |  45 lines

  1. package sheet;
  2.  
  3. import java.util.EmptyStackException;
  4.  
  5. class CellCalc$IntegerStack {
  6.    private short[] data;
  7.    private short top;
  8.  
  9.    private CellCalc$IntegerStack() {
  10.       this.data = new short[10];
  11.       this.top = 0;
  12.    }
  13.  
  14.    public void clear() {
  15.       this.top = 0;
  16.    }
  17.  
  18.    public boolean isEmpty() {
  19.       return this.top == 0;
  20.    }
  21.  
  22.    public void push(short var1) throws IllegalArgumentException {
  23.       if (this.top < this.data.length) {
  24.          short[] var10000 = this.data;
  25.          short var10003 = this.top;
  26.          this.top = (short)(var10003 + 1);
  27.          var10000[var10003] = var1;
  28.       } else {
  29.          throw new IllegalArgumentException("Too complex expression");
  30.       }
  31.    }
  32.  
  33.    public short pop() throws EmptyStackException {
  34.       if (this.top > 0) {
  35.          return this.data[--this.top];
  36.       } else {
  37.          throw new EmptyStackException();
  38.       }
  39.    }
  40.  
  41.    CellCalc$IntegerStack(CellCalc.1 var1) {
  42.       this();
  43.    }
  44. }
  45.