org.codehaus.jam
Class JamClassIterator

java.lang.Object
  extended by org.codehaus.jam.JamClassIterator
All Implemented Interfaces:
java.util.Iterator

public class JamClassIterator
extends java.lang.Object
implements java.util.Iterator

A typed Iterator on a set of JClasses. The use of JamClassIterator (as opposed to arrays or Collections of JClass) is encouraged as it can significantly reduce memory consumption when using JAM to process large numbers of java classes.

Author:
Patrick Calahan <email: pcal-at-bea-dot-com>

Constructor Summary
JamClassIterator(JamClassLoader loader, java.lang.String[] classes)
          Constructs a new JamClassIterator
 
Method Summary
 int getSize()
           
 boolean hasNext()
          Returns true if classes remain to be iterated upon.
 java.lang.Object next()
          Returns the next class.
 JClass nextClass()
          Returns the next class.
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JamClassIterator

public JamClassIterator(JamClassLoader loader,
                        java.lang.String[] classes)
Constructs a new JamClassIterator

Parameters:
loader - JamClassLoader from which to load the classes
classes - Array of full-qualified classnames to iterate on.
Throws:
java.lang.IllegalArgumentException - if either argument is null.
Method Detail

nextClass

public JClass nextClass()
Returns the next class. Exactly equivalent to (JClass)next().

Throws:
java.lang.IndexOutOfBoundsException - if there are no classes left to iterate on.

hasNext

public boolean hasNext()
Returns true if classes remain to be iterated upon.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next class.

Specified by:
next in interface java.util.Iterator
Throws:
java.lang.IndexOutOfBoundsException - if there are no classes left to iterate on.

getSize

public int getSize()

remove

public void remove()
Not supported.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException