org.crosswire.jsword.passage
Class RangedPassage.VerseIterator

java.lang.Object
  extended by org.crosswire.jsword.passage.RangedPassage.VerseIterator
All Implemented Interfaces:
Iterator<Key>
Enclosing class:
RangedPassage

private static final class RangedPassage.VerseIterator
extends Object
implements Iterator<Key>

This class is here to prevent users of RangedPassage.iterator() from altering the underlying store and getting us out of sync. Right now there are no issues with someone else removing a RangedPassage without telling us, however there may be some day, and I'm not sure that we need the functionality right now. Also buy using this we get to ensure synchronization. Everything is final so to save the proxying performace hit.


Field Summary
private  Iterator<Key> real
          The Iterator that we are proxying to
 
Constructor Summary
RangedPassage.VerseIterator(Versification v11n, Iterator<VerseRange> it)
          Create a basic iterator that is a proxy for the RangedPassage Passages iterator, with remove() overridden.
 
Method Summary
 boolean hasNext()
           
 Key next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

real

private Iterator<Key> real
The Iterator that we are proxying to

Constructor Detail

RangedPassage.VerseIterator

public RangedPassage.VerseIterator(Versification v11n,
                                   Iterator<VerseRange> it)
Create a basic iterator that is a proxy for the RangedPassage Passages iterator, with remove() overridden.

Parameters:
v11n - the versification to which this reference pertains
it -
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Key>

next

public Key next()
         throws NoSuchElementException
Specified by:
next in interface Iterator<Key>
Throws:
NoSuchElementException

remove

public void remove()
            throws UnsupportedOperationException
Specified by:
remove in interface Iterator<Key>
Throws:
UnsupportedOperationException

Copyright ยจ 2003-2015