FreeHEP API
Version current

org.freehep.util.parameterdatabase
Class ClassIterator

java.lang.Object
  extended byorg.freehep.util.parameterdatabase.ClassIterator
All Implemented Interfaces:
Iterator

public class ClassIterator
extends Object
implements Iterator

This iterator iterates up the class hierarchy. The first element returned is always the initial defining object (which can also be a class). Each subsequent element returned is the superclass of the previous one; if the previous element was not a Class, then that object's Class is returned.

Source Code:
ClassIterator.java

Field Summary
protected  Object current
          The reference to the object which will be returned by the next call to next().
protected  Object root
          This is the initial root object which starts the iteration.
 
Constructor Summary
ClassIterator(Object start)
          Constructor requires an object on which to start the iteration.
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
          The remove() method is not supported by this iterator.
 void reset()
          This resets the iterator to the saved starting object.
 void reset(Object start)
          This resets the iterator to the given starting object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected Object root
This is the initial root object which starts the iteration.


current

protected Object current
The reference to the object which will be returned by the next call to next().

Constructor Detail

ClassIterator

public ClassIterator(Object start)
Constructor requires an object on which to start the iteration. The starting object may be a Class.

Method Detail

reset

public void reset(Object start)
This resets the iterator to the given starting object. This allows the iterator to be reused. Note that all references to external classes can be cleared by passing in null here.


reset

public void reset()
This resets the iterator to the saved starting object.


hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
The remove() method is not supported by this iterator.

Specified by:
remove in interface Iterator

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.