org.geotools.data.store
Class NoContentIterator

Object
  extended by NoContentIterator
All Implemented Interfaces:
Iterator<SimpleFeature>

public class NoContentIterator
extends Object
implements Iterator<SimpleFeature>

This iterator is used to indicate that contents could not be aquired.

The normal Collection.iterator() method does not let us return an error (we always have to return an iterator). However Iterator.next() can be used to return an NoSuchElementException.

So we are basically going to lie, we are going to pretend their is content *once*, and when they ask for it we are going to hit them with a NoSuchElementExcetion. This is a mean trick, but it does convey the idea of asking for content that is supposed to be there and failing to aquire it.

Since:
2.1.RC0
Author:
jgarnett
Module:
modules/library/main (gt-main.jar)

Constructor Summary
NoContentIterator(Throwable t)
           
 
Method Summary
 boolean hasNext()
           
 SimpleFeature next()
           
 void remove()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoContentIterator

public NoContentIterator(Throwable t)
Method Detail

hasNext

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

next

public SimpleFeature next()
Specified by:
next in interface Iterator<SimpleFeature>

remove

public void remove()
Specified by:
remove in interface Iterator<SimpleFeature>


Copyright © 1996-2009 Geotools. All Rights Reserved.