code: public Enumeration<E> elements() {
          return new Enumeration<E>() {
              int count = 0;
  
              public boolean hasMoreElements() {
                  return count < elementCount;
              }
  
              public E nextElement() {
                  synchronized (Vector.this) {
                      if (count < elementCount) {
                          return elementData(count++);
                      }
                  }
                  throw new NoSuchElementException("Vector Enumeration");
              }
          };
      }
docs: Returns an enumeration of the components of this vector. The
  returned {@code Enumeration} object will generate all items in
  this vector. The first item generated is the item at index {@code 0},
  then the item at index {@code 1}, and so on.
  
  @return  an enumeration of the components of this vector
  @see     Iterator