1. /*
  2. * @(#)Iterable.java 1.3 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang;
  8. import java.util.Iterator;
  9. /** Implementing this interface allows an object to be the target of
  10. * the "foreach" statement.
  11. */
  12. public interface Iterable<T> {
  13. /**
  14. * Returns an iterator over a set of elements of type T.
  15. *
  16. * @return an Iterator.
  17. */
  18. Iterator<T> iterator();
  19. }