Holger's
Java API

com.antelmann.calendar
Class SQLCalendarEntryIterator

java.lang.Object
  extended by com.antelmann.util.AbstractIterator<CalendarEntry>
      extended by com.antelmann.calendar.SQLCalendarEntryIterator
All Implemented Interfaces:
Closeable, Iterable<CalendarEntry>, Enumeration<CalendarEntry>, Iterator<CalendarEntry>

public class SQLCalendarEntryIterator
extends AbstractIterator<CalendarEntry>

Author:
Holger Antelmann

Constructor Summary
SQLCalendarEntryIterator(SQLCalendarDB db, Filter<CalendarEntry> filter)
           
SQLCalendarEntryIterator(SQLCalendarDB db, ResultSet set, Filter<CalendarEntry> filter, boolean closeOnEnd)
          the ResultSet as well as the creating Statement are both closed only if closeOnEnd is true
 
Method Summary
 SQLException getException()
          returns an exception in case one occurred
protected  CalendarEntry getNextElement()
          if no more Element is available, this method is to return null or throw any Exception.
 ResultSet getResultSet()
           
 
Methods inherited from class com.antelmann.util.AbstractIterator
allowsNull, asIterable, close, concat, concat, convert, convert, count, currentElement, emptyEnumeration, emptyIterable, emptyIterator, enumerate, filter, filter, getAll, getCount, getEndCondition, getFilter, hasMoreElements, hasNext, iterate, iterate, iterator, list, list, list, list, monitor, monitor, next, nextElement, process, process, propagatesException, remove, reverseEnumeration, setAllowNull, setFilter, setPropagateException, sortEnumeration, sortEnumeration, stopIteration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLCalendarEntryIterator

public SQLCalendarEntryIterator(SQLCalendarDB db,
                                Filter<CalendarEntry> filter)
                         throws SQLException
Throws:
SQLException

SQLCalendarEntryIterator

public SQLCalendarEntryIterator(SQLCalendarDB db,
                                ResultSet set,
                                Filter<CalendarEntry> filter,
                                boolean closeOnEnd)
                         throws SQLException
the ResultSet as well as the creating Statement are both closed only if closeOnEnd is true

Throws:
SQLException
Method Detail

getException

public SQLException getException()
returns an exception in case one occurred


getResultSet

public ResultSet getResultSet()

getNextElement

protected CalendarEntry getNextElement()
                                throws SQLException
Description copied from class: AbstractIterator
if no more Element is available, this method is to return null or throw any Exception. Errors (as opposed to Exceptions) are not caught, i.e. they would always be thrown directly and unwrapped during next().

Specified by:
getNextElement in class AbstractIterator<CalendarEntry>
Throws:
SQLException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads