gov.sns.xal.model
Class CompositeGlobalIterator

java.lang.Object
  |
  +--gov.sns.xal.model.CompositeGlobalIterator
All Implemented Interfaces:
java.util.Iterator

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

Implementation of an iterator class for IComposite objects. Returns each interface in the sequence, leaf or branch. Consequently the returned interface should be typed to IComponent. The iteration order for child composite elements isparent first then all its children.

See Also:
IComposite

Constructor Summary
CompositeGlobalIterator(IComposite ifcComp)
          Create a new CompositeGlobalIterator object connected to the specific IComposite interface.
 
Method Summary
 boolean hasNext()
          Check if there are more objects to be iterated.
 java.lang.Object next()
          Return the current object and advance index.
 void remove()
          Remove the last element returned by the iterator through the method next().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeGlobalIterator

public CompositeGlobalIterator(IComposite ifcComp)
Create a new CompositeGlobalIterator object connected to the specific IComposite interface.

Parameters:
ifcComp - interface to composite element to iterate
Method Detail

hasNext

public boolean hasNext()
Check if there are more objects to be iterated.

Specified by:
hasNext in interface java.util.Iterator
Returns:
false if we are at the end of the list, true otherwise
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Return the current object and advance index.

Specified by:
next in interface java.util.Iterator
Returns:
current object in iterator
See Also:
Iterator.next()

remove

public void remove()
Remove the last element returned by the iterator through the method next().

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove(), Iterator.next()