org.progeeks.util
Class ClassIterator

java.lang.Object
  extended by org.progeeks.util.ClassIterator
All Implemented Interfaces:
java.util.Iterator

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

Given a class, this iterator will traverse the class hierarchy from the specified class, through its interfaces, to the parent class with its interfaces, and so on.

Version:
$Revision: 1.5 $
Author:
Paul Speed

Constructor Summary
ClassIterator(java.lang.Class type)
          Creates a class iterator that traverses the specified class, its interfaces, to the parent class with its interfaces, and so on.
ClassIterator(java.lang.Class type, boolean includeInterfaces)
          Creates a class iterator that traverses the specified class and its parent classes.
 
Method Summary
 boolean hasNext()
           
static void main(java.lang.String[] args)
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassIterator

public ClassIterator(java.lang.Class type)
Creates a class iterator that traverses the specified class, its interfaces, to the parent class with its interfaces, and so on.


ClassIterator

public ClassIterator(java.lang.Class type,
                     boolean includeInterfaces)
Creates a class iterator that traverses the specified class and its parent classes. Interfaces are not included if includeInterfaces is false.

Method Detail

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2002-2003 Paul Speed. All Rights Reserved.