1 5 package com.teamkonzept.lib; 6 7 11 public class TKDBResultIterator implements TKListIterator { 12 13 protected TKListIterator oldIterator; 14 protected String listName; 15 protected TKDBResult result; 16 17 public TKDBResultIterator( TKDBResult result, TKListIterator oldIterator, String listName ) 18 { 19 this.oldIterator = oldIterator; 20 this.listName = listName; 21 this.result = result; 22 } 23 24 public boolean apply( TKTemplate template, int i, String currListName ) 25 { 26 if( currListName.equalsIgnoreCase( listName ) ) { 27 if( i >= result.size() ) return false; 28 boolean retVal = TKDBTemplate.prepareTemplate( (TKDBResultRow) result.get(i), template ); 29 if( oldIterator != null ) { 30 oldIterator.apply( template, i, currListName ); 31 } 32 return retVal; 33 } 34 else if( oldIterator != null ) { 35 return oldIterator.apply( template, i, currListName ); 36 } 37 else { 38 return false; 39 } 40 } 41 42 } 43 44 45 | Popular Tags |