home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / naming / NameImplEnumerator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  654 b   |  30 lines

  1. package javax.naming;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.NoSuchElementException;
  5. import java.util.Vector;
  6.  
  7. final class NameImplEnumerator implements Enumeration {
  8.    Vector vector;
  9.    int count;
  10.    int limit;
  11.  
  12.    NameImplEnumerator(Vector var1, int var2, int var3) {
  13.       this.vector = var1;
  14.       this.count = var2;
  15.       this.limit = var3;
  16.    }
  17.  
  18.    public boolean hasMoreElements() {
  19.       return this.count < this.limit;
  20.    }
  21.  
  22.    public Object nextElement() {
  23.       if (this.count < this.limit) {
  24.          return this.vector.elementAt(this.count++);
  25.       } else {
  26.          throw new NoSuchElementException("NameImplEnumerator");
  27.       }
  28.    }
  29. }
  30.