2.17.2: 2011-06-17

net.sf.basedb.core
Class ReporterScoreResultIterator

java.lang.Object
  extended by net.sf.basedb.core.ReporterScoreResultIterator
All Implemented Interfaces:
Iterator<ReporterScore>, QueryResult, ResultIterator<ReporterScore>

public class ReporterScoreResultIterator
extends Object
implements ResultIterator<ReporterScore>

This is a temporary solution for returning reporter list scores as an iterator. This class will be replaced by a more generic query functionality in the future.

Version:
2.0
Author:
Nicklas
See Also:
ReporterList
Last modified
$Date: 2008-09-11 22:11:02 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  ScrollIterator<ReporterListScoreData> data
          The internal iterator of data layer objects.
private  DbControl dc
          The DbControl that was used in the query.
private  Item itemType
          The type of items returned by the query.
private  long totalCount
          The total number of items.
 
Constructor Summary
ReporterScoreResultIterator(ScrollIterator<ReporterListScoreData> data, DbControl dc, long totalCount)
           
 
Method Summary
 void close()
          From the ResultIterator interface ---------------------------------
 Item getItemType()
          Get the type of items contained in this list.
 long getTotalCount()
          From the QueryResult interface ---------------------------------
 boolean hasNext()
           
 boolean isClosed()
          Check if the iterator has been closed.
 ReporterScore next()
           
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private final ScrollIterator<ReporterListScoreData> data
The internal iterator of data layer objects.


dc

private final DbControl dc
The DbControl that was used in the query.


totalCount

private final long totalCount
The total number of items.


itemType

private final Item itemType
The type of items returned by the query.

Constructor Detail

ReporterScoreResultIterator

ReporterScoreResultIterator(ScrollIterator<ReporterListScoreData> data,
                            DbControl dc,
                            long totalCount)
Method Detail

getTotalCount

public long getTotalCount()
From the QueryResult interface ---------------------------------

Specified by:
getTotalCount in interface QueryResult
Returns:
The total number of items, or -1 if not known
See Also:
Query.setReturnTotalCount(boolean)

close

public void close()
From the ResultIterator interface ---------------------------------

Specified by:
close in interface ResultIterator<ReporterScore>

isClosed

public boolean isClosed()
Description copied from interface: ResultIterator
Check if the iterator has been closed.

Specified by:
isClosed in interface ResultIterator<ReporterScore>

hasNext

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

next

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

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<ReporterScore>
Throws:
UnsupportedOperationException - Always

getItemType

public Item getItemType()
Get the type of items contained in this list.

Returns:
An Item object or null if not known

2.17.2: 2011-06-17