1 package org.sapia.ubik.mcast; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 6 7 17 public class RespList { 18 private List _resps; 19 20 23 public RespList(int capacity) { 24 _resps = new ArrayList (capacity); 25 } 26 27 32 public void addResponse(Response resp) { 33 _resps.add(resp); 34 } 35 36 42 public Response get(int index) { 43 return (Response) _resps.get(index); 44 } 45 46 54 public boolean containsError() { 55 Response r; 56 57 for (int i = 0; i < _resps.size(); i++) { 58 r = (Response) _resps.get(i); 59 60 if (r.isError()) { 61 return true; 62 } 63 } 64 65 return false; 66 } 67 68 77 public boolean containsSuspect() { 78 Response r; 79 80 for (int i = 0; i < _resps.size(); i++) { 81 r = (Response) _resps.get(i); 82 83 if (r.isError()) { 84 return true; 85 } 86 } 87 88 return false; 89 } 90 91 96 public int count() { 97 return _resps.size(); 98 } 99 } 100 | Popular Tags |