org.openrdf.sail.rdbms.iteration.base
Class RdbmIterationBase<T,X extends Exception>

java.lang.Object
  extended by org.openrdf.sail.rdbms.iteration.base.RdbmIterationBase<T,X>
All Implemented Interfaces:
CloseableIteration<T,X>, Iteration<T,X>
Direct Known Subclasses:
RdbmsBindingIteration, RdbmsResourceIteration, RdbmsStatementIteration

public abstract class RdbmIterationBase<T,X extends Exception>
extends Object
implements CloseableIteration<T,X>

Base class for Iteration of a ResultSet.

Author:
James Leigh

Constructor Summary
RdbmIterationBase(PreparedStatement stmt)
           
 
Method Summary
 void close()
          Closes this iteration, freeing any resources that it is holding.
protected abstract  T convert(ResultSet rs)
           
protected abstract  X convertSQLException(SQLException e)
           
 boolean hasNext()
          Returns true if the iteration has more elements.
 T next()
          Returns the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by the iteration (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdbmIterationBase

public RdbmIterationBase(PreparedStatement stmt)
                  throws SQLException
Throws:
SQLException
Method Detail

close

public void close()
           throws X extends Exception
Description copied from interface: CloseableIteration
Closes this iteration, freeing any resources that it is holding. If the iteration has already been closed then invoking this method has no effect.

Specified by:
close in interface CloseableIteration<T,X extends Exception>
Throws:
X extends Exception

hasNext

public boolean hasNext()
                throws X extends Exception
Description copied from interface: Iteration
Returns true if the iteration has more elements. (In other words, returns true if Iteration.next() would return an element rather than throwing a NoSuchElementException.)

Specified by:
hasNext in interface Iteration<T,X extends Exception>
Returns:
true if the iteration has more elements.
Throws:
X
X extends Exception

next

public T next()
       throws X extends Exception
Description copied from interface: Iteration
Returns the next element in the iteration.

Specified by:
next in interface Iteration<T,X extends Exception>
Returns:
the next element in the iteration.
Throws:
X extends Exception

remove

public void remove()
            throws X extends Exception
Description copied from interface: Iteration
Removes from the underlying collection the last element returned by the iteration (optional operation). This method can be called only once per call to next.

Specified by:
remove in interface Iteration<T,X extends Exception>
Throws:
X extends Exception

convert

protected abstract T convert(ResultSet rs)
                      throws SQLException
Throws:
SQLException

convertSQLException

protected abstract X convertSQLException(SQLException e)


Copyright © 2001-2012 Aduna. All Rights Reserved.