org.eclipse.emf.ecore.util
Class EcoreUtil.ContentTreeIterator.ResourcesIterator

java.lang.Object
  extended byorg.eclipse.emf.ecore.util.EcoreUtil.ContentTreeIterator.ResourcesIterator
All Implemented Interfaces:
Iterator
Enclosing class:
EcoreUtil.ContentTreeIterator

protected static class EcoreUtil.ContentTreeIterator.ResourcesIterator
extends Object
implements Iterator

A special iterator that's tolerant of growth in the list of resources which can result from demand loading when traversing the tree of contents.


Field Summary
protected  int index
          The current index of the iterator.
protected  List resources
          The resources to iterator over.
 
Constructor Summary
EcoreUtil.ContentTreeIterator.ResourcesIterator(List resources)
          Constructs an instance.
 
Method Summary
 boolean hasNext()
          Returns whether there might be resources left by the time we next check.
 Object next()
          Returns the next item, or null if there isn't one.
 boolean reallyHasNext()
          Returns whether there really are any resources left.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

protected List resources
The resources to iterator over.


index

protected int index
The current index of the iterator.

Constructor Detail

EcoreUtil.ContentTreeIterator.ResourcesIterator

public EcoreUtil.ContentTreeIterator.ResourcesIterator(List resources)
Constructs an instance.

Parameters:
resources - the list of resources.
Method Detail

reallyHasNext

public boolean reallyHasNext()
Returns whether there really are any resources left.

Returns:
whether there really are any resources left.

hasNext

public boolean hasNext()
Returns whether there might be resources left by the time we next check. This returns true when the index is equal to the size, because the tree iterator will still be set to yield the last of the contents of the resource, and accessing that may cause another resource to be loaded.

Specified by:
hasNext in interface Iterator
Returns:
whether there might be resources left by the time we next check.

next

public Object next()
Returns the next item, or null if there isn't one.

Specified by:
next in interface Iterator
Returns:
the next item, or null if there isn't one.

remove

public void remove()
Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always.

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.