01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/lib/TKResultSetIterator.java,v 1.6 2001/03/06 14:57:24 alex Exp $
03: *
04: */
05: package com.teamkonzept.lib;
06:
07: import java.sql.*;
08:
09: //--------------------------------------------------------------------------------//
10: //--------------------------CLASS TKDBListIterator--------------------------------//
11: //--------------------------------------------------------------------------------//
12:
13: public class TKResultSetIterator implements TKListIterator {
14:
15: protected TKListIterator oldIterator;
16: protected String listName;
17: protected ResultSet resultSet;
18:
19: public TKResultSetIterator(ResultSet resultSet,
20: TKListIterator oldIterator, String listName) {
21: this .oldIterator = oldIterator;
22: this .listName = listName;
23: this .resultSet = resultSet;
24: }
25:
26: public boolean apply(TKTemplate template, int i, String currListName) {
27: if (currListName.equalsIgnoreCase(listName)) {
28: return TKDBTemplate.prepareTemplate(resultSet, template);
29: } else if (oldIterator != null) {
30: return oldIterator.apply(template, i, currListName);
31: } else {
32: return false;
33: }
34: }
35:
36: }
|