jdsl.core.api
Interface LocatorIterator

All Superinterfaces:
ObjectIterator
All Known Implementing Classes:
ArrayLocatorIterator

public interface LocatorIterator
extends ObjectIterator

Iterator over a set of locators. No order of the locators is required by this interface, although order may be promised or required by users of the interface. Conceptually, the iterator starts out positioned before the first locator to be considered. With each call to next(), the iterator skips over another locator and returns the locator skipped over, until the iterator is positioned after the last locator. Note that NoSuchElementException indicates two different failure states: when the iterator is positioned before the first locator, locator(), key(), and element() fail; when the iterator is positioned after the last locator, next() fails.

Version:
$Id: LocatorIterator.java,v 1.3 1999/08/02 21:15:48 mdh Exp $
Author:
Mark Handy

Method Summary
 java.lang.Object element()
          Shortcut for locator().element().
 java.lang.Object key()
          Shortcut for locator().key()
 Locator locator()
           
 Locator nextLocator()
           
 
Methods inherited from interface jdsl.core.api.ObjectIterator
hasNext, nextObject, object, reset
 

Method Detail

nextLocator

public Locator nextLocator()
                    throws java.util.NoSuchElementException
Returns:
Next locator to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last locator

locator

public Locator locator()
                throws java.util.NoSuchElementException
Returns:
The locator returned by the most recent next()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-locator state

key

public java.lang.Object key()
                     throws java.util.NoSuchElementException
Shortcut for locator().key()
Returns:
Key of the locator that would be returned by locator()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-locator state

element

public java.lang.Object element()
                         throws java.util.NoSuchElementException
Shortcut for locator().element(). Same as the inherited object() method.
Returns:
Element of the locator that would be returned by locator()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-locator state