1 28 package de.nava.informa.utils.poller; 29 30 import de.nava.informa.core.ChannelIF; 31 import de.nava.informa.core.ItemIF; 32 33 import java.util.List ; 34 import java.util.Vector ; 35 36 41 class CompositeApprover implements PollerApproverIF { 42 private List approvers = new Vector (); 43 44 51 public final boolean canAddItem(ItemIF item, ChannelIF channel) { 52 boolean result = true; 53 int i = 0; 54 final int size = approvers.size(); 55 while (i < size && result) { 56 final PollerApproverIF approver = (PollerApproverIF) approvers.get(i); 57 result = approver.canAddItem(item, channel); 58 i++; 59 } 60 61 return result; 62 } 63 64 69 public final void add(PollerApproverIF approver) { 70 if (!approvers.contains(approver)) { 71 approvers.add(approver); 72 } 73 } 74 75 80 public final void remove(PollerApproverIF approver) { 81 approvers.remove(approver); 82 } 83 } 84 | Popular Tags |