Class ResultSetIterator<T>

java.lang.Object
games.stendhal.tools.loganalyser.util.ResultSetIterator<T>
Type Parameters:
T - object type
All Implemented Interfaces:
Iterable<T>, Iterator<T>
Direct Known Subclasses:
GameEventEntryIterator, LogEntryIterator

public abstract class ResultSetIterator<T> extends Object implements Iterator<T>, Iterable<T>
Iterates over a database query ResultSet-object doing all the magic that is required to query a ResultSet.
Author:
hendrik
  • Field Details

  • Constructor Details

    • ResultSetIterator

      public ResultSetIterator(ResultSet resultSet)
      Creates a new ResultSetIterator.
      Parameters:
      resultSet - resultSet
    • ResultSetIterator

      public ResultSetIterator(Statement statement, ResultSet resultSet)
      Creates a new ResultSetIterator.
      Parameters:
      statement - statement
      resultSet - resultSet
  • Method Details

    • createObject

      protected abstract T createObject()
      Creates the object instance.
      Returns:
      T
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>