1 package com.teamkonzept.lib; 2 3 public class TKStandardPluginIterator implements TKListIterator { 4 5 TKListIterator oldIterator; 6 TKHashtableIteratorPlugin hash; 7 TKVectorIteratorPlugin vec; 8 9 public TKStandardPluginIterator (String listName, String itemName,TKHashtable hash, 10 boolean doSort, TKListIterator oldIterator) { 11 12 this.oldIterator = oldIterator; 13 this.hash = new TKHashtableIteratorPlugin (listName,itemName,hash,doSort); 14 this.vec = null; 15 } 16 17 public TKStandardPluginIterator(String listName, String itemName, TKVector vec, 18 boolean doSort, TKListIterator oldIterator) { 19 20 this.oldIterator = oldIterator; 21 this.vec = new TKVectorIteratorPlugin (listName,itemName,vec,doSort); 22 this.hash = null; 23 } 24 25 public boolean apply( TKTemplate template, int i, String currListName ) { 26 27 if ((vec != null) && vec.apply (template,i,currListName,null)) return true; 28 else if ((hash != null) && hash.apply (template,i,currListName,null)) return true; 29 else if (oldIterator != null) return oldIterator.apply (template,i,currListName); 30 else return false; 31 } 32 } 33 | Popular Tags |