1 package com.opensymphony.workflow.designer; 2 3 import java.util.ArrayList ; 4 import java.util.Iterator ; 5 import java.util.List ; 6 7 import com.opensymphony.workflow.loader.ResultDescriptor; 8 9 public class ResultHolderList extends ArrayList 10 { 11 public List getResultsToStep(int stepId) 12 { 13 Iterator results = iterator(); 14 List returnValue = new ArrayList (); 15 while(results.hasNext()) 16 { 17 ResultHolder result = (ResultHolder)results.next(); 18 if(stepId == result.getStep()) 19 { 20 returnValue.add(result); 21 } 22 } 23 return returnValue; 24 } 25 26 public List getResultsToSplit(int splitId) 27 { 28 Iterator results = iterator(); 29 List returnValue = new ArrayList (); 30 while(results.hasNext()) 31 { 32 ResultHolder result = (ResultHolder)results.next(); 33 if(splitId == result.getSplit()) 34 { 35 returnValue.add(result); 36 } 37 } 38 return returnValue; 39 } 40 41 public List getResultsToJoin(int joinId) 42 { 43 Iterator results = iterator(); 44 List returnValue = new ArrayList (); 45 while(results.hasNext()) 46 { 47 ResultHolder result = (ResultHolder)results.next(); 48 if(joinId == result.getJoin()) 49 { 50 returnValue.add(result); 51 } 52 } 53 return returnValue; 54 } 55 56 public ResultHolder getResultCell(ResultDescriptor result) 57 { 58 ResultHolder ret = null; 59 60 Iterator iter = iterator(); 61 while(iter.hasNext()) 62 { 63 ret = (ResultHolder)iter.next(); 64 if(ret.getDescriptor() == result) 65 { 66 return ret; 67 } 68 } 69 70 return null; 71 } 72 } 73 | Popular Tags |