home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / WIN95 / IAVAZIP.EXE / DATA.Z / StringVector.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-08-18  |  818 b   |  39 lines

  1. package com.sfs.html;
  2.  
  3. class StringVector {
  4.    private String[] data = new String[100];
  5.    private int size;
  6.    private int index;
  7.  
  8.    protected void reset() {
  9.       this.index = 0;
  10.    }
  11.  
  12.    protected String nextElement() {
  13.       return this.data[this.index++];
  14.    }
  15.  
  16.    protected boolean hasMoreElements() {
  17.       return this.index < this.size;
  18.    }
  19.  
  20.    protected void addElement(String var1) {
  21.       if (this.size == this.data.length) {
  22.          String[] var2 = new String[2 * this.size];
  23.          System.arraycopy(this.data, 0, var2, 0, this.size);
  24.          this.data = var2;
  25.       }
  26.  
  27.       this.data[this.size++] = var1;
  28.    }
  29.  
  30.    protected void trimToSize() {
  31.       if (this.size < this.data.length) {
  32.          String[] var1 = new String[this.size];
  33.          System.arraycopy(this.data, 0, var1, 0, this.size);
  34.          this.data = var1;
  35.       }
  36.  
  37.    }
  38. }
  39.