1 7 8 package javax.management.relation; 9 10 import java.util.ArrayList ; 11 import java.util.List ; 12 import java.util.Iterator ; 13 14 21 public class RoleUnresolvedList extends ArrayList { 22 23 24 private static final long serialVersionUID = 4054902803091433324L; 25 26 30 33 public RoleUnresolvedList() { 34 super(); 35 return; 36 } 37 38 44 public RoleUnresolvedList(int theInitialCapacity) { 45 super(theInitialCapacity); 46 return; 47 } 48 49 63 public RoleUnresolvedList(List theList) 64 throws IllegalArgumentException { 65 66 if (theList == null) { 67 String excMsg = "Invalid parameter"; 68 throw new IllegalArgumentException (excMsg); 69 } 70 71 int i = 0; 72 for (Iterator eltIter = theList.iterator(); 73 eltIter.hasNext();) { 74 Object currElt = eltIter.next(); 75 if (!(currElt instanceof RoleUnresolved )) { 76 StringBuffer excMsgStrB = new StringBuffer (); 77 String excMsg = "An element is not a RoleUnresolved at index "; 78 excMsgStrB.append(excMsg); 79 excMsgStrB.append(i); 80 throw new IllegalArgumentException (excMsgStrB.toString()); 81 } 82 i++; 83 super.add(currElt); 84 } 85 return; 86 } 87 88 92 99 public void add(RoleUnresolved theRoleUnres) 100 throws IllegalArgumentException { 101 102 if (theRoleUnres == null) { 103 String excMsg = "Invalid parameter"; 104 throw new IllegalArgumentException (excMsg); 105 } 106 super.add(theRoleUnres); 107 return; 108 } 109 110 124 public void add(int index, 125 RoleUnresolved theRoleUnres) 126 throws IllegalArgumentException , 127 IndexOutOfBoundsException { 128 129 if (theRoleUnres == null) { 130 String excMsg = "Invalid parameter"; 131 throw new IllegalArgumentException (excMsg); 132 } 133 134 super.add(index, theRoleUnres); 135 return; 136 } 137 138 151 public void set(int index, 152 RoleUnresolved theRoleUnres) 153 throws IllegalArgumentException , 154 IndexOutOfBoundsException { 155 156 if (theRoleUnres == null) { 157 String excMsg = "Invalid parameter"; 158 throw new IllegalArgumentException (excMsg); 159 } 160 161 super.set(index, theRoleUnres); 162 return; 163 } 164 165 178 public boolean addAll(RoleUnresolvedList theRoleUnresolvedList) 179 throws IndexOutOfBoundsException { 180 181 if (theRoleUnresolvedList == null) { 182 return true; 183 } 184 185 return (super.addAll(theRoleUnresolvedList)); 186 } 187 188 203 public boolean addAll(int index, 204 RoleUnresolvedList theRoleUnresolvedList) 205 throws IllegalArgumentException , 206 IndexOutOfBoundsException { 207 208 if (theRoleUnresolvedList == null) { 209 String excMsg = "Invalid parameter"; 210 throw new IllegalArgumentException (excMsg); 211 } 212 213 return (super.addAll(index, theRoleUnresolvedList)); 214 } 215 } 216 | Popular Tags |