org.ozoneDB.collections
Class _BaseTreeMap_OzoneTreeIteratorImpl

java.lang.Object
  extended byorg.ozoneDB.OzoneObject
      extended byorg.ozoneDB.collections._BaseTreeMap_OzoneTreeIteratorImpl
All Implemented Interfaces:
java.util.Iterator, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, OzoneIterator, org.ozoneDB.OzoneRemote, java.io.Serializable

public class _BaseTreeMap_OzoneTreeIteratorImpl
extends org.ozoneDB.OzoneObject
implements OzoneIterator

DO NOT USE THIS CLASS DIRECTLY.

This should be an inner class; ozone unfortunately does not (yet) support inner classes as Ozone objects. Until it does we have to resort to this hack.

Note that this class resembles _BaseTreeMap_TreeIterator.

TODO: as soon as Ozone supports server side objects that are not storable, this class has to be rewritten to such a server side non-persistent object.

See Also:
Serialized Form

Constructor Summary
_BaseTreeMap_OzoneTreeIteratorImpl(BaseTreeMap owner, int type)
           
_BaseTreeMap_OzoneTreeIteratorImpl(BaseTreeMap owner, int type, BaseTreeMap.Node first, BaseTreeMap.Node max)
           
 
Method Summary
 boolean hasNext()
          Returns true if the Iterator has more elements.
 java.lang.Object next()
          Returns the next element in the Iterator's sequential view.
 void remove()
          Removes from the backing TreeMap the last element which was fetched with the next() method.
 
Methods inherited from class org.ozoneDB.OzoneObject
container, database, deleteRecursive, equals, getHandle, getObjectID, handle, hashCode, onActivate, onCreate, onDelete, onPassivate, requireWriteLocking, self, setContainer, toString, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy
getObjectID
 

Constructor Detail

_BaseTreeMap_OzoneTreeIteratorImpl

public _BaseTreeMap_OzoneTreeIteratorImpl(BaseTreeMap owner,
                                          int type)

_BaseTreeMap_OzoneTreeIteratorImpl

public _BaseTreeMap_OzoneTreeIteratorImpl(BaseTreeMap owner,
                                          int type,
                                          BaseTreeMap.Node first,
                                          BaseTreeMap.Node max)
Method Detail

hasNext

public boolean hasNext()
Returns true if the Iterator has more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there are more elements
Throws:
java.util.ConcurrentModificationException - if the TreeMap was modified

next

public java.lang.Object next()
Returns the next element in the Iterator's sequential view.

Specified by:
next in interface OzoneIterator
Returns:
the next element
Throws:
java.util.ConcurrentModificationException - if the TreeMap was modified
java.util.NoSuchElementException - if there is none

remove

public void remove()
Removes from the backing TreeMap the last element which was fetched with the next() method.

Specified by:
remove in interface OzoneIterator
Throws:
java.util.ConcurrentModificationException - if the TreeMap was modified
java.lang.IllegalStateException - if called when there is no last element


Copyright © 2004 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.